From: pk910 Date: Sun, 2 Oct 2011 16:30:00 +0000 (+0200) Subject: fixed NULL-Pointer bug when performing oper cmd's in the Bots query X-Git-Tag: v5.3~348 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=97fcc6cabc4812ba2683be567cd40822204c0d5e fixed NULL-Pointer bug when performing oper cmd's in the Bots query --- 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)); + } } }