Skip to content

Commit

Permalink
cacher: add check for nil utxo
Browse files Browse the repository at this point in the history
  • Loading branch information
jazg committed Dec 5, 2019
1 parent 9bac440 commit c34b946
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cacher/cacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ func (cacher *Cacher) storeGHash(request jsonrpc.Request) error {

func (cacher *Cacher) validate(network btctypes.Network, args abi.Args) error {
client := btcclient.NewClient(cacher.logger.WithField("blockchain", "btc"), network)
utxo := args.Get("utxo").Value.(abi.ExtBtcCompatUTXO)
utxoArg := args.Get("utxo")
if utxoArg.IsNil() {
return fmt.Errorf("utxo cannot be nil")
}
utxo := utxoArg.Value.(abi.ExtBtcCompatUTXO)

// Calculate the gateway hash from the input arguments.
var gatewayArgs abi.Args
Expand Down

0 comments on commit c34b946

Please sign in to comment.