Skip to content

Commit

Permalink
Fix NPE on WatchQueueReader (openhab#2563)
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Tanagra <jimmy@tanagra.id.au>
GitOrigin-RevId: 8343703
  • Loading branch information
jimtng authored and splatch committed Jul 12, 2023
1 parent a695b6f commit ef6c66a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef6c66a

Please sign in to comment.