New J2K: Fix explicit NPE cases in conversions

This commit is contained in:
Ilya Kirillov
2019-04-08 19:01:12 +03:00
parent 4c58016fa4
commit bd53772f5c
2 changed files with 2 additions and 2 deletions
@@ -83,7 +83,7 @@ class JKSymbolProvider {
} }
} }
fun transferSymbol(to: JKDeclaration, from: JKDeclaration) = symbolsByJK[from]!!.let { fun transferSymbol(to: JKDeclaration, from: JKDeclaration) = symbolsByJK[from]?.also {
it as JKUniverseSymbol<JKTreeElement> it as JKUniverseSymbol<JKTreeElement>
it.target = to it.target = to
symbolsByJK[to] = it symbolsByJK[to] = it
@@ -53,7 +53,7 @@ class ImplicitInitializerConversion(private val context: ConversionContext) : Re
.toMap() .toMap()
fun JKMethodSymbol.parentConstructor(): JKMethodSymbol? = fun JKMethodSymbol.parentConstructor(): JKMethodSymbol? =
(symbolToConstructor[this]!!.delegationCall as? JKDelegationConstructorCall) (symbolToConstructor[this]?.delegationCall as? JKDelegationConstructorCall)
?.identifier ?.identifier
val constructors = containingClass.declarationList val constructors = containingClass.declarationList