Skip to content

Commit

Permalink
(NOBIDS) fix internal server error on withdrawals page, remove error …
Browse files Browse the repository at this point in the history
…in GetDataTableState
  • Loading branch information
peterbitfly committed Mar 9, 2023
1 parent 554b2cb commit 919007e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,7 @@ func GetSlotWithdrawals(slot uint64) ([]*types.Withdrawals, error) {
func GetTotalWithdrawals() (total uint64, err error) {
err = ReaderDb.Get(&total, `
SELECT
MAX(withdrawalindex)
COALESCE(MAX(withdrawalindex), 0)
FROM
blocks_withdrawals`)
if err == sql.ErrNoRows {
Expand Down
3 changes: 2 additions & 1 deletion handlers/common.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package handlers

import (
"database/sql"
"encoding/hex"
"encoding/json"
"errors"
Expand Down Expand Up @@ -328,7 +329,7 @@ func GetDataTableState(user *types.User, session *utils.CustomSession, tableKey
}
if user.Authenticated {
state, err := db.GetDataTablesState(user.UserID, tableKey)
if err != nil {
if err != nil && err != sql.ErrNoRows {
logger.Errorf("error getting data table state from db: %v", err)
return state
}
Expand Down

0 comments on commit 919007e

Please sign in to comment.