Skip to content
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

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jun 11, 2021

Fixes: #17854

@geoand geoand requested a review from gsmet June 11, 2021 08:33
@@ -51,7 +51,7 @@ void setUpDenyAllJaxRs(CombinedIndexBuildItem index,
JaxRsSecurityConfig config,
ResteasyDeploymentBuildItem resteasyDeployment,
BuildProducer<AdditionalSecuredClassesBuildItem> additionalSecuredClasses) {
if (config.denyJaxRs) {
if ((config.denyJaxRs) && (resteasyDeployment != null)) {
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

@gsmet gsmet left a 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.

@gsmet gsmet added triage/waiting-for-ci Ready to merge when CI successfully finishes triage/backport? labels Jun 11, 2021
@geoand geoand merged commit 5f8b782 into quarkusio:main Jun 11, 2021
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 11, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jun 11, 2021
@geoand geoand deleted the #17854 branch June 11, 2021 12:43
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.0.Final Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException in build when denying unannotated endpoints
2 participants