From 8491feff3630c0ec388058e35b585755466270e2 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Sat, 14 Apr 2012 22:10:26 +0200 Subject: [PATCH] Fix assertion if FS root is not readable (e.g. http://devnet.jetbrains.net/message/5457053) --- .../intellij/openapi/vfs/impl/local/LocalFileSystemBase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java index 7421e201cbc9..f70f3064294b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java @@ -213,7 +213,9 @@ public abstract class LocalFileSystemBase extends LocalFileSystem { final File[] roots = File.listRoots(); if (roots.length == 1 && roots[0].getName().isEmpty()) { final String[] list = roots[0].list(); - return list != null ? list : ArrayUtil.EMPTY_STRING_ARRAY; + if (list != null) return list; + LOG.warn("Root '" + roots[0] + "' has no children - is it readable?"); + return ArrayUtil.EMPTY_STRING_ARRAY; } if (file.getName().isEmpty()) { // return drive letter names for the 'fake' root on windows