diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 08723d73..79f5ecdd 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -2979,6 +2979,10 @@ NAN_METHOD(WalletGetAccountAddress) { strAccount = std::string(*account_); } + if (strAccount == EMPTY) { + return NanThrowError("No account provided."); + } + std::string ret = GetAccountAddress(strAccount).ToString(); NanReturnValue(NanNew(ret.c_str())); @@ -3189,6 +3193,10 @@ NAN_METHOD(WalletSetRecipient) { strAccount = std::string(*account_); } + if (strAccount == EMPTY) { + return NanThrowError("No account provided."); + } + CTxDestination address = CBitcoinAddress(addr).Get(); pwalletMain->SetAddressBook(address, strAccount, "send"); pwalletMain->SetAddressBook(address, strAccount, "send");