From dd830f4adffedef41e20e30513fe6c61ee6201f9 Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Thu, 20 Oct 2016 15:49:48 +0300 Subject: [PATCH] EA-89820 - NPE: HighlightDisplayLevel$SingleColorIcon.getColorInner --- .../codeHighlighting/HighlightDisplayLevel.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java b/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java index 11d4278e8818..dd5570497b14 100644 --- a/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java +++ b/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 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. @@ -151,10 +151,10 @@ public class HighlightDisplayLevel { Color getColor(); } - public static class SingleColorIcon implements Icon, ColoredIcon { + private static class SingleColorIcon implements Icon, ColoredIcon { private final TextAttributesKey myKey; - public SingleColorIcon(@NotNull TextAttributesKey key) { + private SingleColorIcon(@NotNull TextAttributesKey key) { myKey = key; } @@ -164,13 +164,13 @@ public class HighlightDisplayLevel { } @Nullable - public Color getColorInner() { + private Color getColorInner() { final EditorColorsManager manager = EditorColorsManager.getInstance(); if (manager != null) { TextAttributes attributes = manager.getGlobalScheme().getAttributes(myKey); - Color stripe = attributes.getErrorStripeColor(); + Color stripe = attributes == null ? null : attributes.getErrorStripeColor(); if (stripe != null) return stripe; - return attributes.getEffectColor(); + return attributes != null ? attributes.getEffectColor() : null; } TextAttributes defaultAttributes = myKey.getDefaultAttributes(); if (defaultAttributes == null) defaultAttributes = TextAttributes.ERASE_MARKER;