Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: should check err no rows (#5623)

p0ny28179899a0bc
diff --git a/backend/store/risk.go b/backend/store/risk.go
index 4f06e694cc..7c608392b0 100644
--- a/backend/store/risk.go
+++ b/backend/store/risk.go
@@ -81,6 +81,9 @@ func (s *Store) GetRisk(ctx context.Context, id int64) (*RiskMessage, error) {
&expressionBytes,
&rowStatus,
); err != nil {
+ if err == sql.ErrNoRows {
+ return nil, nil
+ }
return nil, errors.Wrap(err, "failed to scan")
}