From dbb7e3cd7242eda21af006a3b766775b5ebf9004 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Wed, 2 Nov 2016 16:03:33 +0100 Subject: [PATCH] EA-91031 - NPE: EmptyMethodInspection$DeleteMethodQuickFix.applyFix --- .../codeInspection/emptyMethod/EmptyMethodInspection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java b/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java index fbb22e5dca2c..04a5dde2460d 100644 --- a/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 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. @@ -377,7 +377,7 @@ public class EmptyMethodInspection extends GlobalJavaBatchInspectionTool { @Nullable final Runnable refreshViews) { for (CommonProblemDescriptor descriptor : descriptors) { RefElement refElement = (RefElement)myProcessor.getElement(descriptor); - if (refElement.isValid() && refElement instanceof RefMethod) { + if (refElement instanceof RefMethod && refElement.isValid()) { RefMethod refMethod = (RefMethod)refElement; if (myNeedToDeleteHierarchy) { deleteHierarchy(refMethod, psiElementsToIgnore);