-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix potential NPE in RESTEasy Classic build time processing #17860
Conversation
@@ -51,7 +51,7 @@ void setUpDenyAllJaxRs(CombinedIndexBuildItem index, | |||
JaxRsSecurityConfig config, | |||
ResteasyDeploymentBuildItem resteasyDeployment, | |||
BuildProducer<AdditionalSecuredClassesBuildItem> additionalSecuredClasses) { | |||
if (config.denyJaxRs) { | |||
if ((config.denyJaxRs) && (resteasyDeployment != null)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn’t the build item mandatory in this case? I’m surprised you don’t have an error instead of a null value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, it's null
. We also make this same check in another place as well.
I also tried it and it fixes the original issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stuartwdouglas is it normal that an injected build item can be null? I thought we needed to use Optional in this case to avoid dependency injection issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember what the behavior is, but I can certainly look into it if this becomes an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge it but I'd like to understand what's going on.
Fixes: #17854