mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
Check for nil to prevent panic.
ok jrick@
This commit is contained in:
parent
88e28a26a8
commit
a702473c57
1 changed files with 12 additions and 2 deletions
14
rpcserver.go
14
rpcserver.go
|
@ -1697,7 +1697,12 @@ func GetAddressesByAccount(w *Wallet, chainSvr *chain.Client, icmd btcjson.Cmd)
|
||||||
func GetBalance(w *Wallet, chainSvr *chain.Client, icmd btcjson.Cmd) (interface{}, error) {
|
func GetBalance(w *Wallet, chainSvr *chain.Client, icmd btcjson.Cmd) (interface{}, error) {
|
||||||
cmd := icmd.(*btcjson.GetBalanceCmd)
|
cmd := icmd.(*btcjson.GetBalanceCmd)
|
||||||
|
|
||||||
err := checkAccountName(*cmd.Account)
|
var account string
|
||||||
|
if cmd.Account != nil {
|
||||||
|
account = *cmd.Account
|
||||||
|
}
|
||||||
|
|
||||||
|
err := checkAccountName(account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -2225,7 +2230,12 @@ func ListSinceBlock(w *Wallet, chainSvr *chain.Client, icmd btcjson.Cmd) (interf
|
||||||
func ListTransactions(w *Wallet, chainSvr *chain.Client, icmd btcjson.Cmd) (interface{}, error) {
|
func ListTransactions(w *Wallet, chainSvr *chain.Client, icmd btcjson.Cmd) (interface{}, error) {
|
||||||
cmd := icmd.(*btcjson.ListTransactionsCmd)
|
cmd := icmd.(*btcjson.ListTransactionsCmd)
|
||||||
|
|
||||||
err := checkAccountName(*cmd.Account)
|
var account string
|
||||||
|
if cmd.Account != nil {
|
||||||
|
account = *cmd.Account
|
||||||
|
}
|
||||||
|
|
||||||
|
err := checkAccountName(account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue