summaryrefslogtreecommitdiff
path: root/ext/dom/element.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/element.c')
-rw-r--r--ext/dom/element.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 3c6bfa1..ac5cd03 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -109,6 +109,12 @@ int dom_element_tag_name_read(dom_object *obj, zval **retval TSRMLS_DC)
xmlChar *qname;
nodep = dom_object_get_node(obj);
+
+ if (nodep == NULL) {
+ php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ return FAILURE;
+ }
+
ALLOC_ZVAL(*retval);
ns = nodep->ns;
if (ns != NULL && ns->prefix) {