Fix KotlinReferenceImporter, add safe call to quickFixActionRanges

HighlightInfo.quickFixActionRanges is nullable in 181
This commit is contained in:
Vyacheslav Gerasimov
2018-03-30 17:04:16 +03:00
parent d2a235b752
commit 22496353b6
@@ -66,7 +66,7 @@ class KotlinReferenceImporter : ReferenceImporter {
): ImportFixBase<out KtExpression>? {
var importFix: ImportFixBase<out KtExpression>? = null
DaemonCodeAnalyzerEx.processHighlights(editor.document, file.project, null, offset, offset) { info ->
importFix = info.quickFixActionRanges.map { it.first.action }.filterIsInstance<ImportFixBase<*>>().firstOrNull()
importFix = info.quickFixActionRanges?.map { it.first.action }?.filterIsInstance<ImportFixBase<*>>()?.firstOrNull()
importFix == null
}
return importFix