mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-29860 fix NPE
This commit is contained in:
+3
-3
@@ -60,12 +60,12 @@ public class XmlTagTreeHighlightingPass extends TextEditorHighlightingPass {
|
||||
.createTextAttributesKey("TAG_TREE_HIGHLIGHTING_KEY"));
|
||||
|
||||
private final XmlFile myFile;
|
||||
private final Editor myEditor;
|
||||
private final EditorEx myEditor;
|
||||
private final BreadcrumbsInfoProvider myInfoProvider;
|
||||
|
||||
private final List<Pair<TextRange, TextRange>> myPairsToHighlight = new ArrayList<Pair<TextRange, TextRange>>();
|
||||
|
||||
public XmlTagTreeHighlightingPass(@NotNull XmlFile file, @NotNull Editor editor) {
|
||||
public XmlTagTreeHighlightingPass(@NotNull XmlFile file, @NotNull EditorEx editor) {
|
||||
super(file.getProject(), editor.getDocument(), true);
|
||||
myFile = file;
|
||||
myEditor = editor;
|
||||
@@ -257,7 +257,7 @@ public class XmlTagTreeHighlightingPass extends TextEditorHighlightingPass {
|
||||
}
|
||||
|
||||
private Color[] toColorsForEditor(Color[] baseColors) {
|
||||
final Color tagBackground = myEditor instanceof EditorEx ? ((EditorEx)myEditor).getBackgroundColor() : null;
|
||||
final Color tagBackground = myEditor.getBackgroundColor();
|
||||
|
||||
if (tagBackground == null) {
|
||||
return baseColors;
|
||||
|
||||
+3
-1
@@ -21,6 +21,7 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
@@ -40,8 +41,9 @@ public class XmlTagTreeHighlightingPassFactory extends AbstractProjectComponent
|
||||
if (editor.isOneLineMode()) return null;
|
||||
|
||||
if (!XmlTagTreeHighlightingUtil.isTagTreeHighlightingActive(file)) return null;
|
||||
if (!(editor instanceof EditorEx)) return null;
|
||||
|
||||
return new XmlTagTreeHighlightingPass((XmlFile)file, editor);
|
||||
return new XmlTagTreeHighlightingPass((XmlFile)file, (EditorEx)editor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user