From 10d6fb8b2b9514baba6e696513be35652097c4e7 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 16 Apr 2021 12:30:59 +0200 Subject: [PATCH] fix npe on fee rates selection toggle --- drongo | 2 +- .../com/sparrowwallet/sparrow/wallet/SendController.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drongo b/drongo index a56f8971..891499af 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit a56f8971c022192dbce0dfc5da3c417b605e4b4f +Subproject commit 891499aff04b69f53bf143464001b96b44a0ec53 diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index d837bec8..f5bec9ff 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -286,9 +286,11 @@ public class SendController extends WalletFormController implements Initializabl updateFeeRateSelection(feeRatesSelection); feeSelectionToggleGroup.selectToggle(feeRatesSelection == FeeRatesSelection.BLOCK_TARGET ? targetBlocksToggle : mempoolSizeToggle); feeSelectionToggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> { - FeeRatesSelection newFeeRatesSelection = (FeeRatesSelection)newValue.getUserData(); - Config.get().setFeeRatesSelection(newFeeRatesSelection); - EventManager.get().post(new FeeRatesSelectionChangedEvent(getWalletForm().getWallet(), newFeeRatesSelection)); + if(newValue != null) { + FeeRatesSelection newFeeRatesSelection = (FeeRatesSelection)newValue.getUserData(); + Config.get().setFeeRatesSelection(newFeeRatesSelection); + EventManager.get().post(new FeeRatesSelectionChangedEvent(getWalletForm().getWallet(), newFeeRatesSelection)); + }; }); fee.setTextFormatter(new CoinTextFormatter());