From 22496353b649dcf4d2a346f1e292435c784a3768 Mon Sep 17 00:00:00 2001 From: Vyacheslav Gerasimov Date: Fri, 30 Mar 2018 17:04:16 +0300 Subject: [PATCH] Fix KotlinReferenceImporter, add safe call to `quickFixActionRanges` HighlightInfo.quickFixActionRanges is nullable in 181 --- .../jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt index 30ad9940d4c..080652dea7f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt @@ -66,7 +66,7 @@ class KotlinReferenceImporter : ReferenceImporter { ): ImportFixBase? { var importFix: ImportFixBase? = null DaemonCodeAnalyzerEx.processHighlights(editor.document, file.project, null, offset, offset) { info -> - importFix = info.quickFixActionRanges.map { it.first.action }.filterIsInstance>().firstOrNull() + importFix = info.quickFixActionRanges?.map { it.first.action }?.filterIsInstance>()?.firstOrNull() importFix == null } return importFix