From 97fcc6cabc4812ba2683be567cd40822204c0d5e Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 2 Oct 2011 18:30:00 +0200 Subject: [PATCH] fixed NULL-Pointer bug when performing oper cmd's in the Bots query --- src/EventLogger.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/EventLogger.c b/src/EventLogger.c index d0b61bd..3bf944b 100644 --- a/src/EventLogger.c +++ b/src/EventLogger.c @@ -59,9 +59,11 @@ void logEvent(struct Event *event) { userid = 0; else userid = atoi(row[0]); - loadChannelSettings(event->chan); - if((event->chan->flags & CHANFLAG_CHAN_REGISTERED)) - printf_mysql_query("INSERT INTO `godlog` (`godlog_cid`, `godlog_uid`, `godlog_time`, `godlog_cmd`) VALUES ('%d', '%d', UNIX_TIMESTAMP(), '%s')", event->chan->channel_id, userid, escape_string(fullcmd)); + if(event->chan) { + loadChannelSettings(event->chan); + if((event->chan->flags & CHANFLAG_CHAN_REGISTERED)) + printf_mysql_query("INSERT INTO `godlog` (`godlog_cid`, `godlog_uid`, `godlog_time`, `godlog_cmd`) VALUES ('%d', '%d', UNIX_TIMESTAMP(), '%s')", event->chan->channel_id, userid, escape_string(fullcmd)); + } } } -- 2.20.1