Skip to content

Commit

Permalink
quickfix for nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
Enerccio committed Jan 28, 2023
1 parent 1e30e6a commit de322f6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main/java/com/en_circle/slt/tools/BufferedString.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ private void truncateAndSet() {
int diff = size - maxSize;
while (!chunks.isEmpty()) {
String left = chunks.removeFirst();
if (left.length() < diff) {
diff -= left.length();
size -= left.length();
} else {
left = left.substring(0, left.length() - diff);
size -= diff;
chunks.addFirst(left);
break;
if (left != null) {
if (left.length() < diff) {
diff -= left.length();
size -= left.length();
} else {
left = left.substring(0, left.length() - diff);
size -= diff;
chunks.addFirst(left);
break;
}
}
}
completeReset.accept(toString());
Expand Down

0 comments on commit de322f6

Please sign in to comment.