mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
Check for 0 shas before dereferencing list
This commit is contained in:
parent
ced24946a4
commit
d81a2c9067
1 changed files with 1 additions and 1 deletions
|
@ -670,7 +670,7 @@ func handleGetRawTransaction(s *rpcServer, cmd btcjson.Cmd, walletNotification c
|
||||||
// this point.
|
// this point.
|
||||||
txSha, _ := btcwire.NewShaHashFromStr(c.Txid)
|
txSha, _ := btcwire.NewShaHashFromStr(c.Txid)
|
||||||
txList, err := s.server.db.FetchTxBySha(txSha)
|
txList, err := s.server.db.FetchTxBySha(txSha)
|
||||||
if err != nil {
|
if err != nil || len(txList) == 0 {
|
||||||
log.Errorf("RPCS: Error fetching tx: %v", err)
|
log.Errorf("RPCS: Error fetching tx: %v", err)
|
||||||
return nil, btcjson.ErrNoTxInfo
|
return nil, btcjson.ErrNoTxInfo
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue