From cc0a787735157addb471d54b803bd8ba02909a70 Mon Sep 17 00:00:00 2001 From: Roman Golyshev Date: Mon, 20 Jul 2020 14:30:33 +0300 Subject: [PATCH] Add null-checking to `KotlinIdeaResolutionException` constructors - NPE here leads to loosing the actual exception - EA-235059 Fixed --- .../idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt index 6ee44477709..6d8b909184d 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt @@ -125,7 +125,10 @@ private class KotlinIdeaResolutionException( }) for (element in resolvingWhat.elements.withIndex()) { withAttachment("element${element.index}.kt", element.value.text) - withAttachment("file${element.index}.kt", element.value.containingFile.text) + withAttachment( + "file${element.index}.kt", + element.value.containingFile?.text ?: "No file! 'element.value' ${element.value} have 'containingFile' == null" + ) } } }