diff --git a/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java index 16a7ecf52c8f..34388c8b2a89 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java @@ -20,6 +20,7 @@ import com.intellij.navigation.ColoredItemPresentation; import com.intellij.navigation.ItemPresentation; import com.intellij.navigation.NavigationItem; import com.intellij.openapi.application.ReadAction; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.editor.markup.TextAttributes; @@ -58,6 +59,7 @@ import java.util.regex.Pattern; import static com.intellij.openapi.vfs.newvfs.VfsPresentationUtil.getFileBackgroundColor; public abstract class PsiElementListCellRenderer extends JPanel implements ListCellRenderer { + private static final Logger LOG = Logger.getInstance("#com.intellij.ide.util.PsiElementListCellRenderer"); private static final String LEFT = BorderLayout.WEST; private static final Pattern CONTAINER_PATTERN = Pattern.compile("(\\(in |\\()?([^)]*)(\\))?"); @@ -161,7 +163,10 @@ public abstract class PsiElementListCellRenderer extends J if (nameAttributes == null) nameAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color); - assert name != null : "Null name for PSI element " + element + " (by " + PsiElementListCellRenderer.this + ")"; + if (name == null) { + LOG.error("Null name for PSI element " + element + " (by " + PsiElementListCellRenderer.this + ")"); + name = "Unknown"; + } SpeedSearchUtil.appendColoredFragmentForMatcher(name, this, nameAttributes, myMatchers.nameMatcher, bgColor, selected); if (!element.isValid()) { append(" Invalid", SimpleTextAttributes.ERROR_ATTRIBUTES);