From 62f6c0843b7077f49ae50fc2b9f398eeaeaede51 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 29 Mar 2012 12:42:42 +0200 Subject: [PATCH] IDEA-83638 (tolerate missing content roots) --- .../roots/ui/configuration/ContentEntryTreeEditor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeEditor.java b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeEditor.java index 1b90c18bfe4c..9eb223dff4ed 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeEditor.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeEditor.java @@ -40,6 +40,8 @@ import com.intellij.openapi.roots.ui.configuration.actions.ToggleExcludedStateAc import com.intellij.openapi.roots.ui.configuration.actions.ToggleSourcesStateAction; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.IconLoader; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.TreeSpeedSearch; @@ -144,8 +146,11 @@ public class ContentEntryTreeEditor { final ContentEntry entry = contentEntryEditor.getContentEntry(); assert entry != null : contentEntryEditor; final VirtualFile file = entry.getFile(); - assert file != null : entry.getUrl(); myDescriptor.setRoots(file); + if (file == null) { + final String path = VfsUtil.urlToPath(entry.getUrl()); + myDescriptor.setTitle(FileUtil.toSystemDependentName(path)); + } final Runnable init = new Runnable() { public void run() {