Skip to content

Commit

Permalink
fix potential substring(0,0)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsgrieve committed Jun 15, 2023
1 parent f111734 commit 7b1218c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ private void parse(String line) {
.findAny()
.ifPresentOrElse(
tuple -> {
setForwardReference(gcid, line.substring(0, end));
// Typically, "end" will be greater than zero, but not always.
setForwardReference(gcid, end > 0 ? line.substring(0, end) : line);
applyRule(tuple.getKey(), tuple.getValue(), line);
},
() -> log(line)
Expand Down

0 comments on commit 7b1218c

Please sign in to comment.