Adam Lounds pointed out a bug in xmlSearchNs() Daniel

* tree.c: Adam Lounds pointed out a bug in xmlSearchNs()
Daniel
diff --git a/tree.c b/tree.c
index 6380461..3370f0e 100644
--- a/tree.c
+++ b/tree.c
@@ -4070,6 +4070,8 @@
     if (node == NULL) return(NULL);
     if ((nameSpace != NULL) &&
 	(xmlStrEqual(nameSpace, (const xmlChar *)"xml"))) {
+	if (doc == NULL)
+	    return(NULL);
 	if (doc->oldNs == NULL) {
 	    /*
 	     * Allocate a new Namespace and fill the fields.