handle elements with null containing file (EA-84533 - IAE: KtPsiFactoryKt.getModuleInfo)
This commit is contained in:
committed by
Ilya Gorbunov
parent
ada6e2a906
commit
221b55550c
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user