mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-decompiler] IDEA-381628 fix PIEAE in ShowDecompiledClassAction#update()
PIEAE: PsiInvalidElementAccessException GitOrigin-RevId: 359b1fc4c78c6ab41d8a09a150cae71cc4e84ec1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
35637e49c6
commit
bb3ed0c94b
+9
-2
@@ -38,8 +38,15 @@ class ShowDecompiledClassAction : AnAction() {
|
||||
|
||||
private fun getPsiElement(e: AnActionEvent): PsiElement? {
|
||||
val project = e.project ?: return null
|
||||
val editor = e.getData(CommonDataKeys.EDITOR) ?: return e.getData(CommonDataKeys.PSI_ELEMENT)
|
||||
return PsiUtilBase.getPsiFileInEditor(editor, project)?.findElementAt(editor.caretModel.offset)
|
||||
val editor = e.getData(CommonDataKeys.EDITOR)
|
||||
val element = if (editor != null) {
|
||||
PsiUtilBase.getPsiFileInEditor(editor, project)?.findElementAt(editor.caretModel.offset)
|
||||
}
|
||||
else {
|
||||
e.getData(CommonDataKeys.PSI_ELEMENT)
|
||||
}
|
||||
if (element == null || !element.isValid) return null
|
||||
return element
|
||||
}
|
||||
|
||||
private fun getOriginalFile(psiElement: PsiElement?): VirtualFile? {
|
||||
|
||||
Reference in New Issue
Block a user