Fix NPE in PersistentInbox (#3215)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2022-12-11 15:49:09 +01:00 committed by GitHub
parent e2bcdcc8f3
commit 5bb31074b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -483,6 +483,8 @@ public final class PersistentInbox implements Inbox, DiscoveryListener, ThingReg
resultImpl.setFlag((flag == null) ? DiscoveryResultFlag.NEW : flag);
discoveryResultStorage.put(resultImpl.getThingUID().toString(), resultImpl);
notifyListeners(resultImpl, EventType.UPDATED);
} else if (result == null) {
logger.warn("Cannot set flag for result '{}' because it can't be found in storage", thingUID);
} else {
logger.warn("Cannot set flag for result of instance type '{}'", result.getClass().getName());
}