mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02: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:
+6
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user