Skip to content

Commit

Permalink
🐛 Fix hidden IllegalDestinationsSetup error
Browse files Browse the repository at this point in the history
The error is thrown when the destination style isn't resolved but this is hidden by a NullPointerException from the toImportable function
  • Loading branch information
MaxMichel2 committed Jun 19, 2024
1 parent 8b4f0c9 commit 31e8db0
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ fun KSType.findActualClassDeclaration(): KSClassDeclaration? {
return declaration as? KSClassDeclaration?
}

fun KSClassDeclaration.toImportable(): Importable {
return Importable(
simpleName.asString(),
qualifiedName!!.asString()
)
fun KSClassDeclaration.toImportable(): Importable? {
return qualifiedName?.let { nonNullQualifiedName ->
Importable(
simpleName.asString(),
nonNullQualifiedName.asString()
)
}
}

val KSClassDeclaration.isNothing get() =
Expand Down

0 comments on commit 31e8db0

Please sign in to comment.