From 5f7815bd547636651773120a62503d15178f1f5b Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Thu, 14 Feb 2019 16:06:47 +0300 Subject: [PATCH] Attempt to fix invalid element exception at suppress intention (EA-135693) --- .../kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt index 8d63747f229..54606b11c82 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt @@ -48,6 +48,7 @@ class KotlinSuppressIntentionAction private constructor( override fun isAvailable(project: Project, editor: Editor?, element: PsiElement) = element.isValid override fun invoke(project: Project, editor: Editor?, element: PsiElement) { + if (!element.isValid) return if (!FileModificationService.getInstance().preparePsiElementForWrite(element)) return val id = "\"$suppressKey\""