Avoid crash when logging a HelpServ request with no request log file.
[srvx.git] / src / mod-helpserv.c
index e360db963379bcac14bb7b58b505aeeaa83c342b..dfb95b60b84b55d6967f53bfe0868b9735d1e30c 100644 (file)
@@ -702,7 +702,7 @@ static void helpserv_log_request(struct helpserv_request *req, const char *reaso
 
     assert(req != NULL);
     assert(reason != NULL);
-    if (!(ctx = saxdb_open_context(reqlog_f)))
+    if (!reqlog_f || !(ctx = saxdb_open_context(reqlog_f)))
         return;
     sprintf(key, "%s-%lu-%lu", req->hs->helpserv->nick, (unsigned long)req->opened, req->id);
     if ((res = setjmp(*saxdb_jmp_buf(ctx))) != 0) {