diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java index 530d0695387c..b72caa437f0a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.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. @@ -751,7 +751,7 @@ public final class IdeKeyEventDispatcher implements Disposable { final List readOnlyActions = Collections.unmodifiableList(actions); for (ActionPromoter promoter : ActionPromoter.EP_NAME.getExtensions()) { final List promoted = promoter.promote(readOnlyActions, myContext.getDataContext()); - if (promoted.isEmpty()) continue; + if (promoted == null || promoted.isEmpty()) continue; actions.removeAll(promoted); actions.addAll(0, promoted); @@ -910,14 +910,16 @@ public final class IdeKeyEventDispatcher implements Disposable { private static class ActionListCellRenderer extends ColoredListCellRenderer { @Override - protected void customizeCellRenderer(final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) { - if (value == null) return; + protected void customizeCellRenderer(@NotNull final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) { if (value instanceof Pair) { + //noinspection unchecked final Pair pair = (Pair) value; append(KeymapUtil.getShortcutText(new KeyboardShortcut(pair.getSecond(), null)), SimpleTextAttributes.GRAY_ATTRIBUTES); appendTextPadding(30); final String text = pair.getFirst().getTemplatePresentation().getText(); - append(text, SimpleTextAttributes.REGULAR_ATTRIBUTES); + if (text != null) { + append(text, SimpleTextAttributes.REGULAR_ATTRIBUTES); + } } } }