Fix potential ArrayOutOfBoundsException
This commit is contained in:
parent
ae3726d906
commit
c081f95d43
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue