diff --git a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java index 5e631483f15d..5e256e719b97 100644 --- a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java +++ b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java @@ -1092,6 +1092,8 @@ public class ShowUsagesAction extends AnAction implements PopupAction { @NotNull FindUsagesOptions options, boolean isWarning) { Runnable runnable = () -> { + if (!handler.getPsiElement().isValid()) return; + JComponent label = createHintComponent(hint, handler, popupPosition, editor, ShowUsagesAction::hideHints, maxUsages, options, isWarning); if (editor == null || editor.isDisposed() || !editor.getComponent().isShowing()) { HintManager.getInstance().showHint(label, popupPosition, HintManager.HIDE_BY_ANY_KEY |