typeOrNull

The type can be null for generic type parameters like T. In this case try to resolve the type with TypeReference.resolveGenericTypeOrNull.