diff options
Diffstat (limited to 'ext/simplexml/simplexml.c')
-rw-r--r-- | ext/simplexml/simplexml.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 15a8512a43..006d6c9491 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1533,15 +1533,18 @@ SXE_METHOD(getDocNamespaces) return; } - array_init(return_value); - sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); if(from_root){ node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr); }else{ GET_NODE(sxe, node); } - + + if (node == NULL) { + RETURN_FALSE; + } + + array_init(return_value); sxe_add_registered_namespaces(sxe, node, recursive, return_value TSRMLS_CC); } /* }}} */ |