Skip to content

Commit

Permalink
Improve null handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Sep 8, 2024
1 parent 3da9227 commit d6a6141
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ public data class TypeData(
val cleaned = split.getOrNull(index)?.trim() ?: ""

val modelKType = kTypeProjection.type
val modelClass = (modelKType?.classifier as? KClass<*>?)!!
val modelClass = (modelKType?.classifier as? KClass<*>?)

createTypeData(cleaned, TypeInfo(modelClass, modelKType.platformType, modelKType))
}.orEmpty()
if (modelClass == null) {
return@mapIndexed null
} else {
createTypeData(cleaned, TypeInfo(modelClass, modelKType.platformType, modelKType))
}
}?.filterNotNull()
.orEmpty()

return TypeData(qualifiedTypename.substringBefore("<"), args, typeInfo = typeInfo)
}
Expand Down

0 comments on commit d6a6141

Please sign in to comment.