From 45f6ba5775193b736172c25569bf4579a9a396cd Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Mon, 17 Oct 2016 14:07:47 +0300 Subject: [PATCH] content entry editor: fast fail if getModel returns null (investigating EA-89693 - NPE: ContentEntryEditor.isExcludedOrUnderExcludedDirectory) (IDEA-CR-14528) --- .../openapi/roots/ui/configuration/ContentEntryEditor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java index a9e9a497add1..00e499a60699 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java @@ -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;