diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshSessionImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshSessionImpl.java index e760233798d1..e2143dd43eea 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshSessionImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshSessionImpl.java @@ -110,9 +110,16 @@ public class RefreshSessionImpl extends RefreshSession { boolean haveEventsToFire = myFinishRunnable != null || !myEvents.isEmpty(); if (!workQueue.isEmpty()) { - LocalFileSystemImpl fs = (LocalFileSystemImpl)LocalFileSystem.getInstance(); - fs.markSuspiciousFilesDirty(workQueue); - FileWatcher watcher = fs.getFileWatcher(); + final LocalFileSystem fileSystem = LocalFileSystem.getInstance(); + final FileWatcher watcher; + if (fileSystem instanceof LocalFileSystemImpl) { + LocalFileSystemImpl fs = (LocalFileSystemImpl)fileSystem; + fs.markSuspiciousFilesDirty(workQueue); + watcher = fs.getFileWatcher(); + } + else { + watcher = null; + } long t = 0; if (LOG.isDebugEnabled()) { @@ -124,7 +131,7 @@ public class RefreshSessionImpl extends RefreshSession { if (myCancelled) break; NewVirtualFile nvf = (NewVirtualFile)file; - if (!myIsRecursive && (!myIsAsync || !watcher.isWatched(nvf))) { + if (!myIsRecursive && (!myIsAsync || (watcher != null && !watcher.isWatched(nvf)))) { // we're unable to definitely refresh synchronously by means of file watcher. nvf.markDirty(); }