From 633ea139a0dab724a0099ffb868016289225e4ec Mon Sep 17 00:00:00 2001 From: Ryan Yeske Date: Tue, 5 Nov 2024 15:02:16 -0700 Subject: [PATCH] Catch no rows error on ?seen command --- handlers/seen.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handlers/seen.go b/handlers/seen.go index fca4734..a5809cb 100644 --- a/handlers/seen.go +++ b/handlers/seen.go @@ -1,6 +1,8 @@ package handlers import ( + "database/sql" + "errors" "goirc/bot" "goirc/model" "goirc/util" @@ -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 }