extra check in cry() for NULL context

This commit is contained in:
Sergey Lyubka
2012-09-18 09:47:29 +01:00
parent 9aad922983
commit 358e4ffbf5
+1 -1
View File
@@ -584,7 +584,7 @@ static void cry(struct mg_connection *conn, const char *fmt, ...) {
// same way string option can.
conn->log_message = buf;
if (call_user(conn, MG_EVENT_LOG) == NULL) {
fp = conn->ctx->config[ERROR_LOG_FILE] == NULL ? NULL :
fp = conn->ctx == NULL || conn->ctx->config[ERROR_LOG_FILE] == NULL ? NULL :
mg_fopen(conn->ctx->config[ERROR_LOG_FILE], "a+");
if (fp != NULL) {