From 1e3b38573d87e00aff1431e51f3c24e4d899ffd6 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 18 Apr 2022 17:44:36 +0200 Subject: [PATCH] [bugfix] Fix infinite domain block database loop (#467) This fixes an issue where the domain block logic would go into an infinite loop. --- internal/db/bundb/instance.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/db/bundb/instance.go b/internal/db/bundb/instance.go index 05e9116b2..24cc6f1be 100644 --- a/internal/db/bundb/instance.go +++ b/internal/db/bundb/instance.go @@ -123,5 +123,10 @@ func (i *instanceDB) GetInstanceAccounts(ctx context.Context, domain string, max if err := q.Scan(ctx); err != nil { return nil, i.conn.ProcessError(err) } + + if len(accounts) == 0 { + return nil, db.ErrNoEntries + } + return accounts, nil }