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++);
|
TableColumn<LoggingEvent, String> location = createTableColumn("Location", 250, idx++);
|
||||||
location.setCellValueFactory(cdf -> {
|
location.setCellValueFactory(cdf -> {
|
||||||
StackTraceElement loc = cdf.getValue().getCallerData()[0];
|
if(cdf.getValue().getCallerData().length > 0) {
|
||||||
String l = loc.getFileName() + ":" + loc.getLineNumber();
|
StackTraceElement loc = cdf.getValue().getCallerData()[0];
|
||||||
return new SimpleStringProperty(l);
|
String l = loc.getFileName() + ":" + loc.getLineNumber();
|
||||||
|
return new SimpleStringProperty(l);
|
||||||
|
} else {
|
||||||
|
return new SimpleStringProperty("");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
table.getColumns().add(location);
|
table.getColumns().add(location);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue