From 88bef568da7180b0a5303a814f02f5549c27620e Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 27 Apr 2007 00:29:26 +0000 Subject: MFH: Fix crash on server startup when log message is printed --- sapi/nsapi/nsapi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sapi/nsapi/nsapi.c') diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index fcd38f023e..dac56dd711 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -709,7 +709,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, "php5", NULL, NULL, "%s", message); + } } static time_t sapi_nsapi_get_request_time(TSRMLS_D) -- cgit v1.2.1