Fix possible issue on db.ErrNoEntries AND non-zero query count

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
This commit is contained in:
kim (grufwub) 2021-08-27 07:33:10 +01:00
commit 57ccbb9e38

View file

@ -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
}