fix potential NPE and regex logic

This commit is contained in:
Mark committed 2026-01-31 19:12:12 +03:00
1 parent 4535d2ba7f
commit 605466e011
1 file changed
+1 -1
@@ -77,7 +77,7 @@ public class JavaTextContainer extends TextContainer {
public void init(String text, int width, int height) {
this.text = text == null ? "" : text.replaceAll("\\r?\\n|\\r", "\n");
lines.clear();
String[] split = text.split("\n", -1);
String[] split = this.text.split("\n", -1);
int totalChars = 0;
for (String l : split) {