Skip to content

Commit

Permalink
Throw Error exception in DOM_GET_OBJ
Browse files Browse the repository at this point in the history
Per general convention for handling of uninitialized objects.
  • Loading branch information
nikic committed Aug 13, 2020
1 parent e17ff61 commit 634dd38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/dom/php_dom.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ entry = zend_register_internal_class_ex(&ce, parent_ce);
#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = Z_DOMOBJ_P(__id); \
if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \
php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", ZSTR_VAL(__intern->std.ce->name));\
RETURN_NULL();\
zend_throw_error(NULL, "Couldn't fetch %s", ZSTR_VAL(__intern->std.ce->name));\
RETURN_THROWS();\
} \
}

Expand Down

0 comments on commit 634dd38

Please sign in to comment.