From 218ce59478232c056b1370426e77ce2ca15c5c86 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 27 Apr 2007 00:29:02 +0000 Subject: [PATCH] Fix crash on server startup when log message is printed --- sapi/nsapi/nsapi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 67f1eedbbd..30da49a2e0 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -705,7 +705,11 @@ static void nsapi_log_message(char *message) TSRMLS_FETCH(); nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - log_error(LOG_INFORM, pblock_findval("fn", rc->pb), rc->sn, rc->rq, "%s", message); + if (rc) { + log_error(LOG_INFORM, pblock_findval("fn", rc->pb), rc->sn, rc->rq, "%s", message); + } else { + log_error(LOG_INFORM, "php6", NULL, NULL, "%s", message); + } } static time_t sapi_nsapi_get_request_time(TSRMLS_D) -- 2.50.1