Fix potential ArrayOutOfBoundsException

This commit is contained in:
0xb00bface 2020-12-19 17:40:53 +01:00
parent ae3726d906
commit c081f95d43
1 changed files with 7 additions and 3 deletions

View File

@ -90,9 +90,13 @@ public class LoggingTab extends Tab {
TableColumn<LoggingEvent, String> location = createTableColumn("Location", 250, idx++);
location.setCellValueFactory(cdf -> {
StackTraceElement loc = cdf.getValue().getCallerData()[0];
String l = loc.getFileName() + ":" + loc.getLineNumber();
return new SimpleStringProperty(l);
if(cdf.getValue().getCallerData().length > 0) {
StackTraceElement loc = cdf.getValue().getCallerData()[0];
String l = loc.getFileName() + ":" + loc.getLineNumber();
return new SimpleStringProperty(l);
} else {
return new SimpleStringProperty("");
}
});
table.getColumns().add(location);