mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix NPE in installers, in headless mode we don't have editor notifications
GitOrigin-RevId: 889dd1d777fea95fcfe862732262709c8d867815
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0f781aafd2
commit
2685e716dc
@@ -17,7 +17,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class ShShellcheckInspection extends LocalInspectionTool implements ExternalAnnotatorBatchInspection {
|
||||
public static final String SHORT_NAME = "ShellCheck";
|
||||
@@ -48,7 +51,10 @@ public class ShShellcheckInspection extends LocalInspectionTool implements Exter
|
||||
}
|
||||
|
||||
Project project = ProjectUtil.guessCurrentProject(myOptionsPanel);
|
||||
EditorNotifications.getInstance(project).updateAllNotifications();
|
||||
EditorNotifications editorNotifications = EditorNotifications.getInstance(project);
|
||||
if (editorNotifications != null) {
|
||||
editorNotifications.updateAllNotifications();
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -79,7 +85,7 @@ public class ShShellcheckInspection extends LocalInspectionTool implements Exter
|
||||
@NotNull
|
||||
static ShShellcheckInspection findShShellcheckInspection(@NotNull PsiElement element) {
|
||||
InspectionProfile profile = InspectionProjectProfileManager.getInstance(element.getProject()).getCurrentProfile();
|
||||
ShShellcheckInspection tool = (ShShellcheckInspection) profile.getUnwrappedTool(SHORT_NAME, element);
|
||||
ShShellcheckInspection tool = (ShShellcheckInspection)profile.getUnwrappedTool(SHORT_NAME, element);
|
||||
return tool == null ? new ShShellcheckInspection() : tool;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user