diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/service/WatchQueueReader.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/service/WatchQueueReader.java index e660272735d..9f2032705eb 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/service/WatchQueueReader.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/service/WatchQueueReader.java @@ -337,8 +337,11 @@ private Path resolvePath(WatchKey key, WatchEvent event) { Path baseWatchedDir = null; Path registeredPath = null; synchronized (this) { - baseWatchedDir = keyToService.get(key).getSourcePath(); - registeredPath = registeredKeys.get(key); + AbstractWatchService service = keyToService.get(key); + if (service != null) { + baseWatchedDir = service.getSourcePath(); + registeredPath = registeredKeys.get(key); + } } if (registeredPath != null) { // If the path has been registered in the watch service it relative path can be resolved