Skip to content

Commit

Permalink
fix(datastore): Prevent panic on GetMulti failure (#9656)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhshkh committed Apr 15, 2024
1 parent 9cb262b commit 55845ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datastore/datastore.go
Expand Up @@ -504,10 +504,11 @@ func (c *Client) get(ctx context.Context, keys []*Key, dst interface{}, opts *pb
ReadOptions: opts,
}
resp, err := c.client.Lookup(ctx, req)
txnID := resp.Transaction

if err != nil {
return txnID, err
return nil, err
}
txnID := resp.Transaction
found := resp.Found
missing := resp.Missing
// Upper bound 1000 iterations to prevent infinite loop. This matches the max
Expand Down

0 comments on commit 55845ad

Please sign in to comment.