From 02f5891ee0eed5ca1bdea2c15e132ba98cfb20ef Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Tue, 30 Oct 2018 15:01:48 +0100 Subject: [PATCH] multiplatformUtil: Do not fail on non-physical classes from java #KT-27907 Fixed --- .../jetbrains/kotlin/idea/caches/project/multiplatformUtil.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/multiplatformUtil.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/multiplatformUtil.kt index b09baf888ff..6f3e3d51be8 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/multiplatformUtil.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/multiplatformUtil.kt @@ -119,7 +119,7 @@ private fun ModuleSourceInfo.toDescriptor() = KotlinCacheService.getInstance(mod fun PsiElement.getPlatformModuleInfo(desiredPlatform: TargetPlatform): PlatformModuleInfo? { assert(desiredPlatform != TargetPlatform.Common) { "Platform module cannot have Common platform" } - val moduleInfo = getModuleInfo() as? ModuleSourceInfo ?: return null + val moduleInfo = getNullableModuleInfo() as? ModuleSourceInfo ?: return null return when (moduleInfo.platform) { TargetPlatform.Common -> { val correspondingImplementingModule = moduleInfo.module.implementingModules.map { it.toInfo(moduleInfo.sourceType) }