diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e0f1655ab7..81c79037c6 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4093,8 +4093,8 @@ util::Result MigrateLegacyToDescriptor(std::shared_ptr // Make list of wallets to cleanup std::vector> created_wallets; - created_wallets.push_back(std::move(res.watchonly_wallet)); - created_wallets.push_back(std::move(res.solvables_wallet)); + if (res.watchonly_wallet) created_wallets.push_back(std::move(res.watchonly_wallet)); + if (res.solvables_wallet) created_wallets.push_back(std::move(res.solvables_wallet)); // Get the directories to remove after unloading for (std::shared_ptr& w : created_wallets) {