fix: handle null path parameter in RestNodesCapabilitiesAction and pr…#113413
fix: handle null path parameter in RestNodesCapabilitiesAction and pr…#113413thecoop merged 5 commits intoelastic:mainfrom
Conversation
|
💚 CLA has been signed |
…event NPE - Added null check for the 'path' parameter in RestNodesCapabilitiesAction to avoid NullPointerException. - If 'path' is not provided, assign an empty string to ensure safe handling in the URLDecoder and other parts of the code. - Updated the response to return a valid node capabilities result with a successful outcome. - Ensured the request behaves properly when no path is provided, preventing crashes.
027e805 to
9796c99
Compare
|
@elasticsearchmachine Could you please assign a reviewer to this PR? Thank you! |
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
|
||
| // Handle the 'path' parameter safely, assign an empty string if null | ||
| String path = request.param("path"); | ||
| if (path != null) { |
There was a problem hiding this comment.
Instead of checking for null, we can just use the default value parameter:
.path(request.param("path", "/"))
There was a problem hiding this comment.
Hi @thecoop,
I've made the requested change to use request.param("path", "/") as the default value for the path parameter instead of checking for null. Please let me know if there are any further adjustments needed.
Thank you!
|
@elasticmachine test this |
|
@nbenliogludev Could you update your branch with latest from main? The changelog also needs to be updated - run |
|
@elasticmachine update branch |
|
@elasticmachine test this |
|
@thecoop, All checks have passed, and the branch is up to date. Could I please get a review and approval for the merge? |
|
All merged, thanks for the fix! |
Fix: handle null path parameter in RestNodesCapabilitiesAction and prevent NPE