From e2425c5b447bbd756de49a3a9a2dd695e6f14093 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 11 Nov 2014 11:07:09 -0800 Subject: [PATCH] throw error if account is not provided. --- src/bitcoindjs.cc | 8 ++++++++ 1 file changed, 8 insertions(+) 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");