Fix assertion if FS root is not readable

(e.g. http://devnet.jetbrains.net/message/5457053)
This commit is contained in:
Roman Shevchenko
2012-04-14 20:35:05 +02:00
parent 8bbb32330f
commit fd174258a4
@@ -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