diff --git a/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/MultiRoutingWatchServiceDelegate.java b/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/MultiRoutingWatchServiceDelegate.java index 674505314df3..fa1e425a7e85 100644 --- a/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/MultiRoutingWatchServiceDelegate.java +++ b/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/MultiRoutingWatchServiceDelegate.java @@ -25,16 +25,21 @@ class MultiRoutingWatchServiceDelegate implements WatchService { @Override public WatchKey poll() { WatchKey watchKey = myDelegate.poll(); + if (watchKey == null) return null; return new MultiRoutingWatchKeyDelegate(watchKey, myProvider); } @Override public WatchKey poll(long timeout, TimeUnit unit) throws InterruptedException { - return null; + WatchKey watchKey = myDelegate.poll(timeout, unit); + if (watchKey == null) return null; + return new MultiRoutingWatchKeyDelegate(watchKey, myProvider); } @Override public WatchKey take() throws InterruptedException { - return null; + WatchKey watchKey = myDelegate.take(); + if (watchKey == null) return null; + return new MultiRoutingWatchKeyDelegate(watchKey, myProvider); } }