throw error if account is not provided.

This commit is contained in:
Christopher Jeffrey 2014-11-11 11:07:09 -08:00
parent 83652317d7
commit e2425c5b44
1 changed files with 8 additions and 0 deletions

View File

@ -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<String>(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");