diff --git a/src/nl/hannahsten/texifyidea/util/parser/Psi.kt b/src/nl/hannahsten/texifyidea/util/parser/Psi.kt index 1b3b66806..0ee9a3bec 100644 --- a/src/nl/hannahsten/texifyidea/util/parser/Psi.kt +++ b/src/nl/hannahsten/texifyidea/util/parser/Psi.kt @@ -32,7 +32,7 @@ fun PsiElement.lineNumber(): Int? = containingFile.document()?.getLineNumber(tex */ fun PsiElement.childrenOfType(clazz: KClass): Collection { return runReadAction { - if (project.isDisposed || !this.isValid) { + if (!this.isValid || project.isDisposed) { emptyList() } else {