mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Fix nullpointer exception in transactions CSV report
1. number of columns in header was incorrect 2. memo field can be null, needed to be converted to empty string Fixes #4333
This commit is contained in:
parent
716947a799
commit
3f8a3c78f3
1 changed files with 4 additions and 3 deletions
|
@ -232,20 +232,21 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
|
|||
|
||||
exportButton.setOnAction(event -> {
|
||||
final ObservableList<TableColumn<TransactionsListItem, ?>> tableColumns = tableView.getColumns();
|
||||
final int reportColumns = tableColumns.size()-1; // CSV report excludes the last column (an icon)
|
||||
CSVEntryConverter<TransactionsListItem> headerConverter = transactionsListItem -> {
|
||||
String[] columns = new String[6];
|
||||
String[] columns = new String[reportColumns];
|
||||
for (int i = 0; i < columns.length; i++)
|
||||
columns[i] = ((AutoTooltipLabel) tableColumns.get(i).getGraphic()).getText();
|
||||
return columns;
|
||||
};
|
||||
CSVEntryConverter<TransactionsListItem> contentConverter = item -> {
|
||||
String[] columns = new String[7];
|
||||
String[] columns = new String[reportColumns];
|
||||
columns[0] = item.getDateString();
|
||||
columns[1] = item.getDetails();
|
||||
columns[2] = item.getDirection() + " " + item.getAddressString();
|
||||
columns[3] = item.getTxId();
|
||||
columns[4] = item.getAmount();
|
||||
columns[5] = item.getMemo();
|
||||
columns[5] = item.getMemo() == null ? "" : item.getMemo();
|
||||
columns[6] = item.getNumConfirmations();
|
||||
return columns;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue