Merge pull request #6381 from jmacxx/fix_issue_6379

Fix NPE when dust tx is shown
This commit is contained in:
Alejandro García 2022-11-25 17:33:07 +02:00 committed by GitHub
commit 78bd0ce688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -393,16 +393,10 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
hyperlinkWithIcon.setOnAction(event -> openDetailPopup(item));
hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openPopupForDetails")));
setGraphic(hyperlinkWithIcon);
// If details are available its a trade tx and we don't expect any dust attack tx
} else {
if (item.isDustAttackTx()) {
hyperlinkWithIcon = new HyperlinkWithIcon(item.getTradable().getId(), AwesomeIcon.WARNING_SIGN);
hyperlinkWithIcon.setOnAction(event -> new Popup().warning(Res.get("funds.tx.dustAttackTx.popup")).show());
setGraphic(hyperlinkWithIcon);
// its a trade tx and we don't expect any dust attack tx
} else {
setGraphic(null);
}
}
} else {
setGraphic(null);
if (hyperlinkWithIcon != null)
@ -431,7 +425,13 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
super.updateItem(item, empty);
if (item != null && !empty) {
if (item.isDustAttackTx()) {
hyperlinkWithIcon = new HyperlinkWithIcon(item.getDetails(), AwesomeIcon.WARNING_SIGN);
hyperlinkWithIcon.setOnAction(event -> new Popup().warning(Res.get("funds.tx.dustAttackTx.popup")).show());
setGraphic(hyperlinkWithIcon);
} else {
setGraphic(new AutoTooltipLabel(item.getDetails()));
}
} else {
setGraphic(null);
}