Minor: Fix NPE in BinaryModuleInfo, handle empty scopes

This commit is contained in:
Yan Zhulanow
2019-06-04 17:53:42 +09:00
parent 71590b6735
commit a575c7e5b5
@@ -435,7 +435,14 @@ interface BinaryModuleInfo : IdeaModuleInfo {
val sourcesModuleInfo: SourceForBinaryModuleInfo?
fun binariesScope(): GlobalSearchScope {
val contentScope = contentScope()
return KotlinSourceFilterScope.libraryClassFiles(contentScope, contentScope.project!!)
if (contentScope === GlobalSearchScope.EMPTY_SCOPE) {
return contentScope
}
val project = contentScope.project
?: error("Project is empty for scope $contentScope (${contentScope.javaClass.name})")
return KotlinSourceFilterScope.libraryClassFiles(contentScope, project)
}
}