content entry editor: fast fail if getModel returns null (investigating EA-89693 - NPE: ContentEntryEditor.isExcludedOrUnderExcludedDirectory) (IDEA-CR-14528)

This commit is contained in:
Sergey Simonchik
2016-10-17 14:07:47 +03:00
parent 86b30355c1
commit 45f6ba5775
@@ -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;