Skip to content

Commit

Permalink
fix the npe issue when is annotated on methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodyiam committed Jun 23, 2024
1 parent 5df2056 commit 4c31386
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ private Object resolvePropertyValue(SpringValue springValue) {
.resolvePropertyValue(beanFactory, springValue.getBeanName(), springValue.getPlaceholder());

if (springValue.isJson()) {
ApolloJsonValue apolloJsonValue = springValue.getField().getAnnotation(ApolloJsonValue.class);
ApolloJsonValue apolloJsonValue = springValue.isField() ?
springValue.getField().getAnnotation(ApolloJsonValue.class) :
springValue.getMethodParameter().getMethodAnnotation(ApolloJsonValue.class);
String datePattern = apolloJsonValue != null ? apolloJsonValue.datePattern() : StringUtils.EMPTY;
value = parseJsonValue((String) value, springValue.getGenericType(), datePattern);
} else {
Expand Down

0 comments on commit 4c31386

Please sign in to comment.