ObjectUtil.notNull for EA-63607 - IAE: ColorIcon.<init>
authorSergey Ignatov <sergey.ignatov@jetbrains.com>
Wed, 24 Dec 2014 12:58:48 +0000 (15:58 +0300)
committerSergey Ignatov <sergey.ignatov@jetbrains.com>
Wed, 24 Dec 2014 13:41:34 +0000 (16:41 +0300)
platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java

index 4455cf0d6767e0cdaf5f96db92668b4d53e13e0a..e7198b5ac44be82e8b53bc3108ab046997e80055 100644 (file)
@@ -21,6 +21,8 @@ import com.intellij.openapi.editor.colors.EditorColorsManager;
 import com.intellij.openapi.editor.colors.TextAttributesKey;
 import com.intellij.openapi.editor.markup.TextAttributes;
 import com.intellij.openapi.util.Comparing;
+import com.intellij.ui.JBColor;
+import com.intellij.util.ObjectUtils;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.ui.ColorIcon;
 import com.intellij.util.ui.JBUI;
@@ -143,7 +145,13 @@ public class HighlightDisplayLevel {
       myKey = key;
     }
 
+    @NotNull
     public Color getColor() {
+      return ObjectUtils.notNull(getColorInner(), JBColor.GRAY);
+    }
+
+    @Nullable
+    public Color getColorInner() {
       final EditorColorsManager manager = EditorColorsManager.getInstance();
       if (manager != null) {
         TextAttributes attributes = manager.getGlobalScheme().getAttributes(myKey);