wallet2_api: check whether dynamic_cast returns NULL

CID 161844
This commit is contained in:
moneromooo-monero 2017-09-10 11:48:52 +01:00
parent 92f2f687b9
commit 44434c8a37
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -105,6 +105,8 @@ Wallet *WalletManagerImpl::createWalletFromKeys(const std::string &path,
bool WalletManagerImpl::closeWallet(Wallet *wallet, bool store)
{
WalletImpl * wallet_ = dynamic_cast<WalletImpl*>(wallet);
if (!wallet_)
return false;
bool result = wallet_->close(store);
if (!result) {
m_errorString = wallet_->errorString();