From 6cbb2a44919e7504602c0ada940ca5836c57dcfe Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 26 Jan 2017 20:35:39 +0100 Subject: [PATCH] Replace incorrect assertion with explicit check (EA-93946 - assert: UnusedSymbolInspection.hasNonTrivialUsages) --- .../jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt index 93547ff1db0..8da4df30ea0 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt @@ -217,7 +217,7 @@ class UnusedSymbolInspection : AbstractKotlinInspection() { var zeroOccurrences = true for (name in listOf(declaration.name) + declaration.getAccessorNames() + declaration.getClassNameForCompanionObject().singletonOrEmptyList()) { - assert(name != null) { "Name is null for " + declaration.getElementTextWithContext() } + if (name == null) continue when (psiSearchHelper.isCheapEnoughToSearch(name!!, useScope, null, null)) { ZERO_OCCURRENCES -> {} // go on, check other names FEW_OCCURRENCES -> zeroOccurrences = false