@@ -4515,14 +4515,19 @@ open class KotlinFileExtractor(
4515
4515
tw.writeHasLocation(constructorBlockId, locId)
4516
4516
4517
4517
// Super call
4518
- val superCallId = tw.getFreshIdLabel<DbSuperconstructorinvocationstmt >()
4519
- tw.writeStmts_superconstructorinvocationstmt(superCallId, constructorBlockId, 0 , ids.constructor )
4518
+ val baseClass = superTypes.first().classOrNull
4519
+ if (baseClass == null ) {
4520
+ logger.warnElement(" Cannot find base class" , currentDeclaration)
4521
+ } else {
4522
+ val superCallId = tw.getFreshIdLabel<DbSuperconstructorinvocationstmt >()
4523
+ tw.writeStmts_superconstructorinvocationstmt(superCallId, constructorBlockId, 0 , ids.constructor )
4520
4524
4521
- val baseConstructor = superTypes.first().classOrNull !! .owner.declarations.find { it is IrFunction && it.symbol is IrConstructorSymbol }
4522
- val baseConstructorId = useFunction<DbConstructor >(baseConstructor as IrFunction )
4525
+ val baseConstructor = baseClass .owner.declarations.find { it is IrFunction && it.symbol is IrConstructorSymbol }
4526
+ val baseConstructorId = useFunction<DbConstructor >(baseConstructor as IrFunction )
4523
4527
4524
- tw.writeHasLocation(superCallId, locId)
4525
- tw.writeCallableBinding(superCallId.cast<DbCaller >(), baseConstructorId)
4528
+ tw.writeHasLocation(superCallId, locId)
4529
+ tw.writeCallableBinding(superCallId.cast<DbCaller >(), baseConstructorId)
4530
+ }
4526
4531
4527
4532
addModifiers(id, " final" )
4528
4533
addVisibilityModifierToLocalOrAnonymousClass(id)
0 commit comments