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

qos: Uncaught NullPointerException due to QoS being set to null #7752

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

khys95
Copy link
Contributor

@khys95 khys95 commented Feb 18, 2025

Motivation: null is a valid value for FileAttribute.QOS_POLICY, however, it is not a valid value to be encapsulated within an Optional.

Modification: Update Optional.of for Optional.ofNullable since the later will take into account null as a value and return Optional.empty() where Optional.of will not and hence throw the NPE.

Result: QosPolicy can still be set to null and we will no longer show a NPE.

Acked-by: Dmitry Litvintsev
Target: master, 10.2, 10.1, 10.0 and 9.2
Require-book: no
Require-notes: no
(cherry picked from commit 466c97e)

Motivation: null is a valid value for FileAttribute.QOS_POLICY, however, it is not a valid value to be encapsulated within an Optional.

Modification: Update Optional.of for Optional.ofNullable since the later will take into account null as a value and return Optional.empty() where Optional.of will not and hence throw the NPE.

Result: QosPolicy can still be set to null and we will no longer show a NPE.

Acked-by: Dmitry Litvintsev
Target: master, 10.2, 10.1, 10.0 and 9.2
Require-book: no
Require-notes: no
(cherry picked from commit 466c97e)
Signed-off-by: khys95 <[email protected]>
@khys95 khys95 merged commit b679ea0 into dCache:10.2 Feb 19, 2025
1 check passed
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.

1 participant