Skip to content

Commit bcec494

Browse files
Do not reply with caught NullRefExceptions in KattGptMessageHandler
1 parent 957c771 commit bcec494

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Kattbot/NotificationHandlers/KattGptMessageHandler.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ public async Task Handle(MessageCreatedNotification notification, CancellationTo
143143
}
144144
catch (Exception ex)
145145
{
146-
await SendTextReply($"Something went wrong: {ex.Message}", message);
146+
if (ex is not NullReferenceException)
147+
{
148+
await SendTextReply($"Something went wrong: {ex.Message}", message);
149+
}
150+
147151
_discordErrorLogger.LogError(ex, ex.Message);
148152
}
149153
}

0 commit comments

Comments
 (0)