Null pointer exception fixes

polling-api
Noah 2023-11-11 15:16:17 -08:00
parent f0a6585af1
commit 356d2ddfa8
1 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import (
// IsLoggingUsername checks whether the app is currently configured to log a user's DMs.
func IsLoggingUsername(sub *Subscriber) bool {
if !config.Current.Logging.Enabled {
if !config.Current.Logging.Enabled || sub == nil {
return false
}
@ -49,7 +49,7 @@ func IsLoggingChannel(channel string) bool {
// LogMessage appends to a user's conversation log.
func LogMessage(sub *Subscriber, otherUsername, senderUsername string, msg messages.Message) {
if !sub.log {
if sub == nil || !sub.log {
return
}