New J2K: check for element validity before applying fix in diagnostic-based post processings
This commit is contained in:
+3
-1
@@ -44,7 +44,9 @@ class DiagnosticBasedPostProcessingGroup(diagnosticBasedProcessings: List<Diagno
|
|||||||
val range = rangeMarker?.range ?: file.textRange
|
val range = rangeMarker?.range ?: file.textRange
|
||||||
if (diagnostic.psiElement.isInRange(range)) {
|
if (diagnostic.psiElement.isInRange(range)) {
|
||||||
diagnosticToFix[diagnostic.factory]?.forEach { fix ->
|
diagnosticToFix[diagnostic.factory]?.forEach { fix ->
|
||||||
runWriteAction { fix(diagnostic) }
|
if (diagnostic.psiElement.isValid) {
|
||||||
|
runWriteAction { fix(diagnostic) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user