Skip to content

Commit 3048cd7

Browse files
author
Rob Richards
committed
fix underlying issue for bug #38438
1 parent 2f01ddf commit 3048cd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/dom/php_dom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ int dom_get_strict_error(php_libxml_ref_obj *document) {
228228
/* {{{ xmlNodePtr dom_object_get_node(dom_object *obj) */
229229
PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj)
230230
{
231-
if (obj->ptr != NULL) {
231+
if (obj && obj->ptr != NULL) {
232232
return ((php_libxml_node_ptr *)obj->ptr)->node;
233233
} else {
234234
return NULL;
@@ -239,7 +239,7 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj)
239239
/* {{{ dom_object *php_dom_object_get_data(xmlNodePtr obj) */
240240
PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj)
241241
{
242-
if (obj->_private != NULL) {
242+
if (obj && obj->_private != NULL) {
243243
return (dom_object *) ((php_libxml_node_ptr *) obj->_private)->_private;
244244
} else {
245245
return NULL;

0 commit comments

Comments
 (0)