From 57ccbb9e38e1af62155e9034d7a74f58a8330654 Mon Sep 17 00:00:00 2001 From: "kim (grufwub)" Date: Fri, 27 Aug 2021 07:33:10 +0100 Subject: [PATCH] Fix possible issue on db.ErrNoEntries AND non-zero query count Signed-off-by: kim (grufwub) --- internal/db/bundb/conn.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/db/bundb/conn.go b/internal/db/bundb/conn.go index 03cbc26e8..bb1a71a8f 100644 --- a/internal/db/bundb/conn.go +++ b/internal/db/bundb/conn.go @@ -34,8 +34,10 @@ func (conn *dbConn) Exists(ctx context.Context, query *bun.SelectQuery) (bool, d // Process error as our own and check if it exists switch err := conn.ProcessError(err); err { - case nil, db.ErrNoEntries: + case nil: return (count != 0), nil + case db.ErrNoEntries: + return false, nil default: return false, err }