content entry editor: fast fail if getModel returns null (investigating EA-89693...
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 17 Oct 2016 11:07:47 +0000 (14:07 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 17 Oct 2016 11:07:47 +0000 (14:07 +0300)
platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java

index a9e9a497add104200f702d33f629b13a3168eb4b..00e499a6069977b81092dbbd1903c75bb2330412 100644 (file)
@@ -289,7 +289,10 @@ public abstract class ContentEntryEditor implements ContentRootPanel.ActionCallb
 
   public boolean isExcludedOrUnderExcludedDirectory(@NotNull VirtualFile file) {
     ModifiableRootModel model = getModel();
-    Project project = model != null ? model.getProject() : null;
+    if (model == null) {
+      throw new AssertionError(getClass() + ".getModel() returned null unexpectedly");
+    }
+    Project project = model.getProject();
     ContentEntry contentEntry = getContentEntry();
     if (contentEntry == null) {
       return false;