Closed lolodomo closed 1 year ago
This is apparently not systematic, I did not get it after a new OH restart.
I can fix the NPE but I wonder how this can happen at all. We first add a discovery result to the storage (in PersistentInbox.internalAdd
) BEFORE we notify the listeners. One of these listeners (AutomaticInboxProcessor
) then tries to set a flag on exactly that result and the recently added result can't be found in the storage.
I wonder, if we should rather use discoveryResult.getThingUID().getAsString()
instead of discoveryResult.getThingUID().toString()
as a key for the results in the PersistentInbox
?
If we have different instances of the ThingUID
class, we might indeed get null
on a get, if I see this correctly.
But AbstractUID.toString
calls AbstractUID.getAsString
and the methods in ThingUID
and UID
call super.toString
/super.getAsString
, so it should be the same. I already had a look at JsonStorage
but didn't see anything wrong there that could produce such an issue.
Ah, you're right, I missed that. Then I don't have any idea either, how this situation can ever happen...
At the startup of OH (snapshot 3215):