From 221b55550c39dfbad02252cadab244ec9bfa1b92 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 13 Oct 2016 19:49:23 +0200 Subject: [PATCH] handle elements with null containing file (EA-84533 - IAE: KtPsiFactoryKt.getModuleInfo) --- .../org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt index 7366211ab39..ffc507ac246 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt @@ -44,7 +44,7 @@ fun PsiElement.getNullableModuleInfo(): IdeaModuleInfo? = this.getModuleInfo { r } private fun PsiElement.getModuleInfo(onFailure: (String) -> IdeaModuleInfo?): IdeaModuleInfo? { - (containingFile.moduleInfo as? IdeaModuleInfo)?.let { return it } + (containingFile?.moduleInfo as? IdeaModuleInfo)?.let { return it } if (this is KtLightElement<*, *>) return this.getModuleInfoForLightElement(onFailure)