Skip to content

Commit

Permalink
MOSIP-32461 code changes
Browse files Browse the repository at this point in the history
Signed-off-by: Sowmya Ujjappa Banakar <[email protected]>
  • Loading branch information
Sowmya Ujjappa Banakar committed Jun 4, 2024
1 parent 9c7ace5 commit e18c161
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ public void validateSignature(String id, String process, BiometricRecord biometr

List<BIR> birs = biometricRecord.getSegments();
for (BIR bir : birs) {
HashMap<String, String> othersInfo = (HashMap<String, String>) bir.getOthers();
Map<String, String> othersInfo = null;
if(bir.getOthers() instanceof HashMap<String, String>) {
othersInfo = (Map<String, String>) bir.getOthers();
}
if (othersInfo == null) {
throw new BiometricSignatureValidationException("Others value is null inside BIR");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,12 @@ private Map<String, String> getQualityTags(List<BIR> birs) throws BiometricExcep
for (BIR bir : birs) {

if (bir.getOthers() != null) {
HashMap<String, String> othersInfo = (HashMap<String, String>) bir.getOthers();
Map<String, String> othersInfo = null;
if (bir.getOthers() instanceof HashMap<String, String>) {
othersInfo = (Map<String, String>) bir.getOthers();
}
boolean exceptionValue = false;
if(othersInfo!=null) {
for (Map.Entry<String, String> other : othersInfo.entrySet()) {
if (other.getKey().equals(EXCEPTION)) {
if (other.getValue().equals(TRUE)) {
Expand All @@ -433,7 +437,7 @@ private Map<String, String> getQualityTags(List<BIR> birs) throws BiometricExcep
break;
}
}

}
if (exceptionValue) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ private void getExceptionAndBiometricInfo(BiometricRecord biometricRecord, Anony

List<BIR> birs = biometricRecord.getSegments();
for (BIR bir : birs) {
HashMap<String, String> othersInfo = (HashMap<String, String>) bir.getOthers();
Map<String, String> othersInfo = null;
if (bir.getOthers() instanceof HashMap<String, String>) {
othersInfo = (Map<String, String>) bir.getOthers();
}

if (othersInfo == null) {
continue;
Expand Down

0 comments on commit e18c161

Please sign in to comment.