Skip to content

Commit

Permalink
Fix #3813 invalid element
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Dec 28, 2024
1 parent 90b30fd commit 25c8218
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nl/hannahsten/texifyidea/util/parser/Psi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fun PsiElement.lineNumber(): Int? = containingFile.document()?.getLineNumber(tex
*/
fun <T : PsiElement> PsiElement.childrenOfType(clazz: KClass<T>): Collection<T> {
return runReadAction {
if (project.isDisposed || !this.isValid) {
if (!this.isValid || project.isDisposed) {
emptyList()
}
else {
Expand Down

0 comments on commit 25c8218

Please sign in to comment.