fix(policies): handle null policies list in listDynamicPolicies#40
Merged
saurabhjain1592 merged 3 commits intomainfrom Jan 6, 2026
Merged
fix(policies): handle null policies list in listDynamicPolicies#40saurabhjain1592 merged 3 commits intomainfrom
saurabhjain1592 merged 3 commits intomainfrom
Conversation
When the API returns {"policies": null} instead of {"policies": []},
the SDK now correctly returns an empty list instead of throwing NPE.
Fixes getaxonflow/axonflow-enterprise#40
- Added changelog entry for null policies list fix - Updated pom.xml version from 2.1.0 to 2.1.1
- Add null checks for wrapper and list fields in: - listDynamicPolicies() - getEffectiveDynamicPolicies() - listStaticPolicies() - getEffectiveStaticPolicies() - Return empty list when wrapper or list is null - Add unit tests for null handling in all 4 methods - Bump version to 2.1.1 Fixes #40
saurabhjain1592
added a commit
that referenced
this pull request
Jan 6, 2026
* fix(policies): handle null policies list in listDynamicPolicies
When the API returns {"policies": null} instead of {"policies": []},
the SDK now correctly returns an empty list instead of throwing NPE.
Fixes getaxonflow/axonflow-enterprise#40
* chore: bump version to 2.1.1 for patch release
- Added changelog entry for null policies list fix
- Updated pom.xml version from 2.1.0 to 2.1.1
* fix: handle null policies list in all policy methods
- Add null checks for wrapper and list fields in:
- listDynamicPolicies()
- getEffectiveDynamicPolicies()
- listStaticPolicies()
- getEffectiveStaticPolicies()
- Return empty list when wrapper or list is null
- Add unit tests for null handling in all 4 methods
- Bump version to 2.1.1
Fixes #40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes NPE when
listDynamicPolicies()receives a response with{"policies": null}.Problem
When the API returns
{"policies": null}(empty state) instead of{"policies": []},the SDK throws
NullPointerExceptionwhen callers try to iterate or call.size()on the result.Solution
Added explicit null check for
wrapper.getPolicies()in addition to the existing null check forwrapper.Returns
Collections.emptyList()for both null cases.Testing