Skip to content

Commit

Permalink
bugfix - check for null before the for-each loop
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Nioche <[email protected]>
  • Loading branch information
jnioche authored and rzo1 committed Oct 31, 2024
1 parent 1c0e33c commit 928c308
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public byte[] format(Tuple tuple) {

// get the metadata key / values to save in the WARCs
for (String key : metadataKeys) {
for (String value : metadata.getValues(key)) {
final String[] values = metadata.getValues(key);
if (values == null || values.length == 0) continue;
for (String value : values) {
if (StringUtils.isBlank(value)) continue;
payload.append(key).append(": ").append(value).append(CRLF);
}
Expand Down

0 comments on commit 928c308

Please sign in to comment.