Skip to content

Commit

Permalink
Merge pull request #934 from gobitfly/BEDS-582/fix_null_error
Browse files Browse the repository at this point in the history
fix(notifications): handle nil pointer exception
  • Loading branch information
peterbitfly authored Oct 10, 2024
2 parents 5a0017f + 1554d5e commit 6cad522
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/pkg/api/data_access/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/gobitfly/beaconchain/pkg/api/enums"
t "github.com/gobitfly/beaconchain/pkg/api/types"
"github.com/gobitfly/beaconchain/pkg/commons/db"
"github.com/gobitfly/beaconchain/pkg/commons/log"
"github.com/gobitfly/beaconchain/pkg/commons/types"
"github.com/gobitfly/beaconchain/pkg/commons/utils"
"github.com/shopspring/decimal"
Expand Down Expand Up @@ -918,7 +919,11 @@ func (d *DataAccessService) GetNotificationSettings(ctx context.Context, userId
result.GeneralSettings.IsMachineMemoryUsageSubscribed = true
result.GeneralSettings.MachineMemoryUsageThreshold = event.Threshold
case types.EthClientUpdateEventName:
clientSettings[event.Filter].IsSubscribed = true
if clientSettings[event.Filter] != nil {
clientSettings[event.Filter].IsSubscribed = true
} else {
log.Warnf("client %s is not found in the client settings", event.Filter)
}
}
}
}
Expand Down

0 comments on commit 6cad522

Please sign in to comment.