Skip to content

Commit

Permalink
Prevent NPE in test catalog handler when prefix not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
jfallows committed Jul 1, 2024
1 parent 39274d9 commit 871773f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public int encode(
next.accept(prefix, 0, prefix.capacity());
}
int valLength = encoder.accept(traceId, bindingId, schemaId, data, index, length, next);
return valLength > 0 ? prefix.capacity() + valLength : -1;
int prefixLen = prefix != null ? prefix.capacity() : 0;
return valLength > 0 ? prefixLen + valLength : -1;
}

@Override
Expand Down

0 comments on commit 871773f

Please sign in to comment.