Skip to content

Commit

Permalink
Fix java.lang.NullPointerException and remove stack trace output from…
Browse files Browse the repository at this point in the history
… ModelResolver
  • Loading branch information
reta authored and frantuma committed Nov 20, 2024
1 parent 3c7b61f commit 3d619b3
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1128,13 +1128,16 @@ private Stream<Annotation> getRecordComponentAnnotations(BeanPropertyDefinition

private Boolean isRecordType(BeanPropertyDefinition propDef){
try {
Class<?> clazz = propDef.getPrimaryMember().getDeclaringClass();
Method isRecordMethod = Class.class.getMethod("isRecord");
return (Boolean) isRecordMethod.invoke(clazz);
if (propDef.getPrimaryMember() != null) {
Class<?> clazz = propDef.getPrimaryMember().getDeclaringClass();
Method isRecordMethod = Class.class.getMethod("isRecord");
return (Boolean) isRecordMethod.invoke(clazz);
} else {
return false;
}
} catch (NoSuchMethodException e) {
return false;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
Expand Down

0 comments on commit 3d619b3

Please sign in to comment.