[Misc] Apply SonarCloud rule cpp:S7172
Description
- Rule name: Use has_value() or another member function to clarify that the code tests the presence of a value in the "optional", not the contained "unsigned long" value itself.
- Rule code: cpp:S7172
- Rule link: https://sonarcloud.io/project/issues?open=AZg_4QwUrKnheRHEMnU8&id=cern-cta_CTA
Checklist
-
Documentation reflects the changes made. -
Merge Request title is clear, concise, and suitable as a changelog entry. See our contributing docs
References
Closes #1384 (closed)