Skip to content

Commit 001a499

Browse files
committed
Fixing tests
1 parent 5bbb190 commit 001a499

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/mastercard/developer/encryption/JweEncryption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private static DocumentContext decryptPayloadPath(DocumentContext payloadContext
140140
//Strip the parent node if empty
141141
String jsonPathInStripped = jsonPathIn.replaceAll("." + config.getEncryptedValueFieldName() + "$", "");
142142
Object inJsonObjectStripped = readJsonObject(payloadContext, jsonPathIn);
143-
if (inJsonObjectStripped == null) {
143+
if (!jsonPathInStripped.equals("$") && !jsonPathInStripped.contains("[") && inJsonObjectStripped == null) {
144144
JsonParser.deleteIfExists(payloadContext, jsonPathInStripped);
145145
}
146146

0 commit comments

Comments
 (0)