Fix null type on simple attribute when value is null in DefaultAttributeFactory#461
Conversation
📝 WalkthroughWalkthroughIn The test suite is extended with a regression test for issue 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #461 +/- ##
============================================
+ Coverage 31.93% 31.96% +0.02%
- Complexity 1112 1114 +2
============================================
Files 137 137
Lines 13523 13526 +3
Branches 2589 2592 +3
============================================
+ Hits 4319 4324 +5
Misses 8666 8666
+ Partials 538 536 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
PR builder started |
|
PR builder completed |
jenkins-is-staging
left a comment
There was a problem hiding this comment.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/27763504657
Root cause and fix
DefaultAttributeFactory.createSimpleAttribute()returns without callingsetType()when the attribute value is null. The type is a schema property and must always be set regardless of value.AbstractValidator.validateReturnedAttributes()callssubAttribute.getType().equals(...)without a null guard, causing NPE when a role's audience sub-attribute has a null value.simpleAttribute.setType(attributeSchema.getType());before the finalreturn simpleAttributeon the null-value path. One-line change; the value-present path is unchanged.Tracking
wso2/product-is#28010