Skip to content

Commit

Permalink
return zero for total count on error
Browse files Browse the repository at this point in the history
  • Loading branch information
badgersrus committed Jul 4, 2024
1 parent 277480a commit c2284ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/host/storage/hostdb/rollup.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ func fetchTotalRollups(db *sql.DB) (*big.Int, error) {
err := db.QueryRow(selectLatestRollupCount).Scan(&total)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, errutil.ErrNotFound
return big.NewInt(0), errutil.ErrNotFound
}
return nil, fmt.Errorf("failed to fetch rollup latest rollup ID: %w", err)
return big.NewInt(0), fmt.Errorf("failed to fetch rollup latest rollup ID: %w", err)
}

bigTotal := big.NewInt(int64(total))
Expand Down

0 comments on commit c2284ca

Please sign in to comment.