fixed a problem with xmlUnlinkNode() for DTDs. Daniel

* tree.c: fixed a problem with xmlUnlinkNode() for DTDs.
Daniel
diff --git a/tree.c b/tree.c
index b2445f0..8da828a 100644
--- a/tree.c
+++ b/tree.c
@@ -3250,10 +3250,12 @@
     if (cur->type == XML_DTD_NODE) {
 	xmlDocPtr doc;
 	doc = cur->doc;
-	if (doc->intSubset == (xmlDtdPtr) cur)
-	    doc->intSubset = NULL;
-	if (doc->extSubset == (xmlDtdPtr) cur)
-	    doc->extSubset = NULL;
+	if (doc != NULL) {
+	    if (doc->intSubset == (xmlDtdPtr) cur)
+		doc->intSubset = NULL;
+	    if (doc->extSubset == (xmlDtdPtr) cur)
+		doc->extSubset = NULL;
+	}
     }
     if (cur->parent != NULL) {
 	xmlNodePtr parent;