Add null checks for error trace fields in SysErrorTransformer to prevent null values

This commit is contained in:
Jan 2025-12-07 21:48:50 +01:00
parent 78f713e4c1
commit 6e80beda14

View file

@ -67,10 +67,10 @@ public class SysErrorTransformer {
while (matcher.find()) {
SysErrorTraceItem item = new SysErrorTraceItem();
item.setFile(matcher.group(2));
item.setLine(Integer.parseInt(matcher.group(3)));
item.setMethod(matcher.group(1));
item.setFullPath("at " + matcher.group(1));
item.setFile(matcher.group(2) == null ? "na" : matcher.group(2));
item.setLine(Integer.parseInt(matcher.group(3) == null ? "0" : matcher.group(3)));
item.setMethod(matcher.group(1) == null ? "na" : matcher.group(1));
item.setFullPath("at " + (matcher.group(1) == null ? "na" : matcher.group(1)));
items.add(item);