Skip to content

Commit

Permalink
Catch no rows error on ?seen command
Browse files Browse the repository at this point in the history
  • Loading branch information
rcy committed Nov 5, 2024
1 parent 0f5f061 commit 633ea13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions handlers/seen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package handlers

import (
"database/sql"
"errors"
"goirc/bot"
"goirc/model"
"goirc/util"
Expand All @@ -13,6 +15,9 @@ func Seen(params bot.HandlerParams) error {

err := model.DB.Get(&channelNick, "select * from channel_nicks where nick = ? and channel = ?", nick, params.Target)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil
}
return err
}

Expand Down

0 comments on commit 633ea13

Please sign in to comment.