Skip to content

Commit 23c833b

Browse files
authored
Fix error checking for QueueLeaves and AddSequencedLeaves in the PostgreSQL storage backend (#3752)
1 parent a4b9999 commit 23c833b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

storage/postgresql/log_storage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ func (t *logTreeTX) QueueLeaves(ctx context.Context, leaves []*trillian.LogLeaf,
457457
}
458458
toRetrieve = append(toRetrieve, leafIdentityHash)
459459
}
460-
if rows.Err() != nil {
460+
if err = rows.Err(); err != nil {
461461
klog.Errorf("Failed processing rows: %s", err)
462462
return nil, postgresqlToGRPC(err)
463463
}
@@ -559,7 +559,7 @@ func (t *logTreeTX) AddSequencedLeaves(ctx context.Context, leaves []*trillian.L
559559
res[i].Status = status.New(codes.FailedPrecondition, "conflicting LeafIndex").Proto()
560560
}
561561
}
562-
if rows.Err() != nil {
562+
if err = rows.Err(); err != nil {
563563
klog.Errorf("Error processing rows: %s", err)
564564
return nil, postgresqlToGRPC(err)
565565
}

0 commit comments

Comments
 (0)