diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java index f8688a41..b0c82d95 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java @@ -153,7 +153,7 @@ public class WalletForm { wallet.clearHistory(); AppServices.clearTransactionHistoryCache(wallet); - EventManager.get().post(new WalletHistoryClearedEvent(wallet, pastWallet, getWalletId())); + EventManager.get().post(new WalletHistoryClearedEvent(wallet, pastWallet == null ? previousWallet : pastWallet, getWalletId())); } else { if(AppServices.isConnected()) { log.error("Error retrieving wallet history", workerStateEvent.getSource().getException());