EA-114090 Fix possible KNPE
authorVitaliy.Bibaev <vitaliy.bibaev@jetbrains.com>
Sun, 17 Dec 2017 17:25:27 +0000 (20:25 +0300)
committerVitaliy.Bibaev <vitaliy.bibaev@jetbrains.com>
Sun, 17 Dec 2017 17:25:27 +0000 (20:25 +0300)
plugins/stats-collector/src/com/intellij/stats/completion/LookupCompletedTracker.kt

index 514e2653c0f370c17f6b74812648dd8e316863ae..2b81c113041cb63065f2ee3f284c7612ec5b7714 100644 (file)
@@ -48,7 +48,7 @@ class LookupCompletedTracker : LookupAdapter() {
     private fun processElementSelected(lookup: LookupImpl, element: LookupElement) {
         val relevanceObjects =
                 lookup.getRelevanceObjects(listOf(element), false)
-        val relevanceMap = relevanceObjects[element]!!.associate { it.first to it.second }
+        val relevanceMap = relevanceObjects[element]?.associate { it.first to it.second } ?: return
         val project = lookup.project
         val featureManager = FeatureManagerImpl.getInstance()
         featureManager.binaryFactors.filter { !featureManager.isUserFeature(it.name) }.forEach { feature ->