Skip to content

Commit

Permalink
Avoid potential NPE when collecting RESTEasy Providers on Resource me…
Browse files Browse the repository at this point in the history
…thods

Fixes: quarkusio#14418
  • Loading branch information
geoand committed Jan 20, 2021
1 parent 500af4d commit 5a58641
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public class ResteasyCommonProcessor {
private static final DotName QUARKUS_JSONB_SERIALIZER = DotName
.createSimple("io.quarkus.resteasy.common.runtime.jsonb.QuarkusJsonbSerializer");

private static final String[] WILDCARD_MEDIA_TYPE_ARRAY = { MediaType.WILDCARD };

private ResteasyCommonConfig resteasyCommonConfig;

@ConfigRoot(name = "resteasy")
Expand Down Expand Up @@ -527,8 +529,12 @@ private static boolean collectDeclaredProvidersForMethodAndMediaTypeAnnotation(S
return true;
}
}
String[] mediaTypes = WILDCARD_MEDIA_TYPE_ARRAY;
if (mediaTypeMethodAnnotationInstance.value() != null) {
mediaTypes = mediaTypeMethodAnnotationInstance.value().asStringArray();
}
if (collectDeclaredProvidersForMediaTypeAnnotationInstance(providersToRegister, categorizedProviders,
mediaTypeMethodAnnotationInstance.value().asStringArray(), methodTarget)) {
mediaTypes, methodTarget)) {
return true;
}

Expand Down

0 comments on commit 5a58641

Please sign in to comment.