summaryrefslogtreecommitdiff
path: root/ext/domxml/php_domxml.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r--ext/domxml/php_domxml.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c
index a42db38bff..bf3fa48014 100644
--- a/ext/domxml/php_domxml.c
+++ b/ext/domxml/php_domxml.c
@@ -2559,6 +2559,12 @@ static void php_xpathptr_new_context(INTERNAL_FUNCTION_PARAMETERS, int mode)
int ret;
id = getThis();
+
+ if (!id) {
+ php_error(E_ERROR, "Invalid object");
+ RETURN_FALSE;
+ }
+
docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC);
#if defined(LIBXML_XPTR_ENABLED)