[FIR] Fix default message test failing with NPE
Return early. Otherwise, if map doesn't contain the key, `get(factory)!!` in the next statement fails with an NPE.
This commit is contained in:
committed by
Space Team
parent
531e4fb86e
commit
83aa014d81
+1
@@ -35,6 +35,7 @@ private val messageParameterRegex = """\{\d.*?}""".toRegex()
|
||||
fun KtDiagnosticFactoryToRendererMap.verifyMessageForFactory(factory: AbstractKtDiagnosticFactory, property: KProperty<*>) = buildList {
|
||||
if (!containsKey(factory)) {
|
||||
add("No default diagnostic renderer is provided for ${property.name}")
|
||||
return@buildList
|
||||
}
|
||||
|
||||
val renderer = get(factory)!!
|
||||
|
||||
Reference in New Issue
Block a user