diff --git a/platform/lang-api/src/com/intellij/codeInsight/daemon/MergeableLineMarkerInfo.java b/platform/lang-api/src/com/intellij/codeInsight/daemon/MergeableLineMarkerInfo.java index b9a7e1ac64b4..faa8fd913933 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/daemon/MergeableLineMarkerInfo.java +++ b/platform/lang-api/src/com/intellij/codeInsight/daemon/MergeableLineMarkerInfo.java @@ -1,6 +1,7 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.daemon; +import com.intellij.ide.IdeBundle; import com.intellij.openapi.editor.markup.GutterIconRenderer; import com.intellij.openapi.ui.popup.IPopupChooserBuilder; import com.intellij.openapi.ui.popup.JBPopupFactory; @@ -144,11 +145,16 @@ public abstract class MergeableLineMarkerInfo extends Line icon = renderer.getIcon(); } PsiElement element = ((LineMarkerInfo)dom).getElement(); - assert element != null; - final String elementPresentation = - dom instanceof MergeableLineMarkerInfo - ? ((MergeableLineMarkerInfo)dom).getElementPresentation(element) - : element.getText(); + final String elementPresentation; + if (element == null) { + elementPresentation = IdeBundle.message("node.structureview.invalid"); + } + else if (dom instanceof MergeableLineMarkerInfo) { + elementPresentation = ((MergeableLineMarkerInfo)dom).getElementPresentation(element); + } + else { + elementPresentation = element.getText(); + } String text = StringUtil.first(elementPresentation, 100, true).replace('\n', ' '); final JBLabel label = new JBLabel(text, icon, SwingConstants.LEFT);