mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-11 05:41:52 +01:00
Fix NPE in WatchServiceImpl (#3633)
It was reported on the forum that in some cases the hash is null. Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
parent
c6a4dd2a31
commit
ee6d7b39b2
@ -223,6 +223,12 @@ public class WatchServiceImpl implements WatchService, DirectoryChangeListener {
|
||||
|
||||
Path path = directoryChangeEvent.path();
|
||||
|
||||
if (directoryChangeEvent.eventType() != DirectoryChangeEvent.EventType.DELETE
|
||||
&& directoryChangeEvent.hash() == null) {
|
||||
logger.warn("Detected invalid event (hash must not be null for CREATE/MODIFY): {}", directoryChangeEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (scheduledEvents) {
|
||||
ScheduledFuture<?> future = scheduledEvents.remove(path);
|
||||
if (future != null && !future.isDone()) {
|
||||
|
Loading…
Reference in New Issue
Block a user