From a7bd910dbb16052077c5c701ca127dd9c24b7b4f Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 8 Dec 2016 22:56:38 +0300 Subject: [PATCH] Don't try to calculate icon for invalid PSI elements #KT-13443 Fixed --- .../idea/structureView/KotlinStructureElementPresentation.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/structureView/KotlinStructureElementPresentation.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/structureView/KotlinStructureElementPresentation.kt index 357cea05705..d09951d81ce 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/structureView/KotlinStructureElementPresentation.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/structureView/KotlinStructureElementPresentation.kt @@ -79,6 +79,10 @@ internal class KotlinStructureElementPresentation( return KotlinDescriptorIconProvider.getIcon(descriptor, navigatablePsiElement, Iconable.ICON_FLAG_VISIBILITY) } + if (!navigatablePsiElement.isValid) { + return null + } + return PsiIconUtil.getProvidersIcon(navigatablePsiElement, Iconable.ICON_FLAG_VISIBILITY) }