fix: NPE in getSDKScore() when SDK omits modality from quality map#790
fix: NPE in getSDKScore() when SDK omits modality from quality map#790ayuxsh009 wants to merge 1 commit into
Conversation
WalkthroughThe PR adds null-safety validation to ChangesSDK Score Null-Safety Check
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Signed-off-by: ayuxsh009 <1raj.aayush@gmail.com>
1b94e95 to
40fb8ba
Compare
Summary
Fixes a
NullPointerExceptioninBioServiceImpl.getSDKScore()whenthe SDK does not return a quality score entry for the requested
BiometricType.Root Cause
scoreMap.get(biometricType)was directly auto-unboxed todouble.If the SDK returned a map without the requested modality key,
get()returnednull, causing aNullPointerExceptionduring unboxing.
The exception bypassed the biometric error handling flow and was
eventually surfaced as
MDS_RCAPTURE_ERROR.Fix #789
Added a null check before unboxing the score value.
If the modality score is absent, the method now throws a
BiometricExceptionwith error codeSDK_SCORE_NULLinstead of allowing an unchecked
NullPointerException.Tests Added
Added regression test cases for:
Both tests verify that
BiometricExceptionis thrown instead of
NullPointerException.Files Changed
BioServiceImpl.javaBioServiceTest.javaSummary by CodeRabbit
Release Notes
Bug Fixes
Tests