mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
NPE (IDEA-160916)
This commit is contained in:
+2
-1
@@ -28,6 +28,7 @@ import com.intellij.codeInspection.ui.InspectionTreeNode;
|
||||
import com.intellij.codeInspection.util.RefFilter;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class DummyEntryPointsPresentation extends UnusedDeclarationPresentation {
|
||||
private static final RefEntryPointFilter myFilter = new RefEntryPointFilter();
|
||||
@@ -43,7 +44,7 @@ public class DummyEntryPointsPresentation extends UnusedDeclarationPresentation
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, InspectionTree tree) {
|
||||
public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, @Nullable InspectionTree tree) {
|
||||
if (myQuickFixActions == null) {
|
||||
myQuickFixActions = new QuickFixAction[]{new MoveEntriesToSuspicious(getToolWrapper())};
|
||||
}
|
||||
|
||||
+2
-2
@@ -192,7 +192,7 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, InspectionTree tree) {
|
||||
public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, @Nullable InspectionTree tree) {
|
||||
boolean showFixes = false;
|
||||
for (RefEntity element : refElements) {
|
||||
if (!getIgnoredRefElements().contains(element) && element.isValid()) {
|
||||
@@ -202,7 +202,7 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
|
||||
}
|
||||
|
||||
if (showFixes) {
|
||||
final TreePath[] paths = tree.getSelectionPaths();
|
||||
final TreePath[] paths = tree != null ? tree.getSelectionPaths() : null;
|
||||
if (paths != null) {
|
||||
long count = Arrays.stream(paths).map(TreePath::getLastPathComponent)
|
||||
.filter(component -> component instanceof ProblemDescriptionNode).count();
|
||||
|
||||
Reference in New Issue
Block a user