fix NPE
authorAlexander Kass <Alexander.Kass@jetbrains.com>
Fri, 7 Aug 2020 11:32:06 +0000 (14:32 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Mon, 10 Aug 2020 15:04:47 +0000 (15:04 +0000)
GitOrigin-RevId: 3716616f0488dc7115515a31dc2218045c2585f4

platform/core-impl/src/com/intellij/psi/impl/ElementBase.java

index 32de90528d2087bf199256a935048e125fc11043..2d7dc4d30516524033d97e2408f3f0af88e0a3f6 100644 (file)
@@ -86,7 +86,7 @@ public abstract class ElementBase extends UserDataHolderBase implements Iconable
       if (baseIcon == null) {
         baseIcon = AstLoadingFilter.disallowTreeLoading(() -> computeBaseIcon(flags));
       }
-      return IconManager.getInstance().createDeferredIcon(baseIcon, new ElementIconRequest(psiElement, psiElement.getProject(), flags), ICON_COMPUTE);
+      return baseIcon == null ? null : IconManager.getInstance().createDeferredIcon(baseIcon, new ElementIconRequest(psiElement, psiElement.getProject(), flags), ICON_COMPUTE);
     }
 
     return computeIconNow(psiElement, flags);