Protect against NPE when resolving generic array
Update ResolvableType to check that the resolved component type from a generic array is not null before attempting to use it to generate the resolved array class. Issue: SPR-11044
This commit is contained in:
@@ -575,7 +575,8 @@ public final class ResolvableType implements Serializable {
|
||||
return (Class<?>) this.type;
|
||||
}
|
||||
if (this.type instanceof GenericArrayType) {
|
||||
return Array.newInstance(getComponentType().resolve(), 0).getClass();
|
||||
Class<?> resolvedComponent = getComponentType().resolve();
|
||||
return (resolvedComponent == null ? null : Array.newInstance(resolvedComponent, 0).getClass());
|
||||
}
|
||||
return resolveType().resolve();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user