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

Avoid NRE in PartDefinition in ContentPartHandlerCoordinator #16717

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

hishamco
Copy link
Member

No description provided.

@agriffard agriffard changed the title Avoid NER in PartDefinition in ContentPartHandlerCoordinator Avoid NRE in PartDefinition in ContentPartHandlerCoordinator Sep 13, 2024
Copy link
Member

@MikeAlhayek MikeAlhayek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hishamco what trigger such a PR? Is there an analyzer that is suggesting that you do this? Such a PR does not add a a much value. I am just wondering what is triggering them as I notices multiple similar PR that you merged lately,

@hishamco
Copy link
Member Author

I'm using a static analyzer, also I can reproduce such issues from within unit tests, we need to make sure nothing should break the code in case we leave the objects null

This should improve the quality

@hishamco hishamco merged commit f9f832a into main Sep 16, 2024
6 checks passed
@hishamco hishamco deleted the hishamco/content-part-handler-coordinator branch September 16, 2024 10:17
@MikeAlhayek
Copy link
Member

@hishamco if there is an analyzer that should be added to your he project I suggest you add it and apply its suggestion using one PR.

Also, in this PR there was no added value because we already are doing null check. You reduced the null check by 1 on every line. But the end result will always be identical. So it's not like we would have gotten a null exception before and now we won't get this check.

If you have a unit test that would throw exception, please keep such a unit test in OC.

@hishamco
Copy link
Member Author

Ok, I will struggle to add more unit tests of the time

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.

2 participants