Index: ext/dom/document.c =================================================================== RCS file: /repository/php-src/ext/dom/document.c,v retrieving revision 1.37 diff -u -r1.37 document.c --- ext/dom/document.c 28 Oct 2003 04:21:29 -0000 1.37 +++ ext/dom/document.c 1 Dec 2003 08:04:31 -0000 @@ -123,8 +123,14 @@ TSRMLS_FETCH(); parser = (xmlParserCtxtPtr) ctx; - php_error_docref(NULL TSRMLS_CC, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line); + if (parser != NULL && parser->input != NULL) { + if (parser->input->filename) { + php_error_docref(NULL TSRMLS_CC, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line); + } else { + php_error_docref(NULL TSRMLS_CC, level, "%s in Entity, line: %d", msg, parser->input->line); + } + } } /* }}} end php_dom_ctx_error */