aboutsummaryrefslogtreecommitdiffstats
path: root/HTMLtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'HTMLtree.c')
-rw-r--r--HTMLtree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/HTMLtree.c b/HTMLtree.c
index c42f8b9f..85bcb1ed 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -745,7 +745,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
xmlInitParser();
- if (cur == NULL) {
+ if ((cur == NULL) || (buf == NULL)) {
return;
}
/*
@@ -753,7 +753,8 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
*/
if (cur->type == XML_DTD_NODE)
return;
- if (cur->type == XML_HTML_DOCUMENT_NODE) {
+ if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
+ (cur->type == XML_DOCUMENT_NODE)){
htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
return;
}