From fd174258a44f6e124d3d84f3b82b51001f6ce2cc Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Sat, 14 Apr 2012 20:34:35 +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 | 3 ++- 1 file changed, 2 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 99a195f8d3c5..7421e201cbc9 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 @@ -212,7 +212,8 @@ public abstract class LocalFileSystemBase extends LocalFileSystem { if (file.getParent() == null) { final File[] roots = File.listRoots(); if (roots.length == 1 && roots[0].getName().isEmpty()) { - return roots[0].list(); + final String[] list = roots[0].list(); + return list != null ? list : ArrayUtil.EMPTY_STRING_ARRAY; } if (file.getName().isEmpty()) { // return drive letter names for the 'fake' root on windows