diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt index 09b9492a239..26a4d16acf5 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt @@ -412,6 +412,7 @@ fun ImportableFqNameClassifier.isImportableDescriptorImported(descriptor: Declar fun OffsetMap.tryGetOffset(key: OffsetKey): Int? { try { + if (!containsOffset(key)) return null return getOffset(key).takeIf { it != -1 } // prior to IDEA 2016.3 getOffset() returned -1 if not found, now it throws exception } catch(e: Exception) {