Skip to content

Commit 299cfca

Browse files
committed
update null value checking and empty string
1 parent edf21ca commit 299cfca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/com/api/util/ApiSecurity/ApiList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public String toString(String delimiter, Boolean sort, Boolean quote, Boolean is
4343
return l1.getKey().equals(l2.getKey()) ? l1.getValue().compareTo(l2.getValue())
4444
: l1.getKey().compareTo(l2.getKey());
4545
})
46-
.map(e -> (e.getValue()=="" && isBaseString) ? e.getKey() : String.format(format, e.getKey(), e.getValue()) )
46+
.map(e -> (null!= e.getValue() && e.getValue().equals("") && isBaseString) ? e.getKey() : String.format(format, e.getKey(), e.getValue()) )
4747
.collect(Collectors.toList());
4848
} else{
4949
list = this.stream().map(e -> String.format(format, e.getKey(), e.getValue()))

src/main/java/com/api/util/ApiSecurity/ApiSigning.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public static String getSignatureToken(
501501

502502
// Generate the nonce value
503503
try {
504-
nonce = nonce != null ? nonce : getNewNonce();
504+
nonce = (nonce != null && !nonce.isEmpty()) ? nonce : getNewNonce();
505505
} catch (NoSuchAlgorithmException nsae) {
506506
throw nsae;
507507
}

0 commit comments

Comments
 (0)