From 999c6846827c13391bb332b004c5deea3e01e059 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Thu, 17 Feb 2022 14:57:44 +0100 Subject: [PATCH] EA-455688 - PIEAE: LeafPsiElement.invalid GitOrigin-RevId: a27ca1abe951be299c4056e942530beee12d7da7 --- .../com/intellij/byteCodeViewer/ShowByteCodeAction.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ShowByteCodeAction.java b/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ShowByteCodeAction.java index e3c5cdd7b6da..3a0a6d8fca59 100644 --- a/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ShowByteCodeAction.java +++ b/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ShowByteCodeAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.byteCodeViewer; import com.intellij.codeInsight.lookup.LookupManager; @@ -83,7 +83,10 @@ final class ShowByteCodeAction extends AnAction implements UpdateInBackground { isMarkedForCompilation(project, virtualFile)) { myErrorTitle = JavaByteCodeViewerBundle.message("class.file.may.be.out.of.date"); } - myByteCode = ReadAction.compute(() -> ByteCodeViewerManager.getByteCode(psiElement)); + myByteCode = ReadAction.compute(() -> { + PsiElement targetElement = element.getElement(); + return targetElement != null ? ByteCodeViewerManager.getByteCode(targetElement) : null; + }); } @Override