mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 00:36:14 -06:00
Fix possible issue on db.ErrNoEntries AND non-zero query count
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
This commit is contained in:
parent
9d8faa490b
commit
57ccbb9e38
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
// Process error as our own and check if it exists
|
||||||
switch err := conn.ProcessError(err); err {
|
switch err := conn.ProcessError(err); err {
|
||||||
case nil, db.ErrNoEntries:
|
case nil:
|
||||||
return (count != 0), nil
|
return (count != 0), nil
|
||||||
|
case db.ErrNoEntries:
|
||||||
|
return false, nil
|
||||||
default:
|
default:
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue