From d58fd8d232378bcf7e07ddf6e24b3620d7684192 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 12 Apr 2016 15:38:51 +0200 Subject: [PATCH] check for null PsiClass.getContainingFile() when filtering dependencies in OrderEntryFix (EA-81471) --- .../codeInsight/daemon/impl/quickfix/OrderEntryFix.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/OrderEntryFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/OrderEntryFix.java index 0ffe3732748b..cdd8e6814326 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/OrderEntryFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/OrderEntryFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -163,7 +163,8 @@ public abstract class OrderEntryFix implements IntentionAction, LocalQuickFix { PsiFile fromFile = element.getContainingFile(); List result = new ArrayList(); for (PsiClass psiClass : classes) { - if (dependencyValidationManager.getViolatorDependencyRule(fromFile, psiClass.getContainingFile()) == null) { + PsiFile containingFile = psiClass.getContainingFile(); + if (containingFile != null && dependencyValidationManager.getViolatorDependencyRule(fromFile, containingFile) == null) { result.add(psiClass); } }