usbwallet: check returned error when decoding hexstr

This commit is contained in:
Lin Corey 2018-11-08 10:48:02 +08:00
parent cf3b187bde
commit b172afd1cc

View file

@ -257,7 +257,10 @@ func (w *ledgerDriver) ledgerDerive(derivationPath []uint32) (common.Address, er
// Decode the hex sting into an Ethereum address and return // Decode the hex sting into an Ethereum address and return
var address common.Address var address common.Address
hex.Decode(address[:], hexstr) _, err = hex.Decode(address[:], hexstr)
if err != nil {
return common.Address{}, err
}
return address, nil return address, nil
} }