diff options
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 3e6e4a0085..fde6fdfd0a 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -2258,19 +2258,18 @@ PHP_FUNCTION(domxml_node_children) last = ((xmlDoc *) nodep)->children; else last = nodep->children; - if (!last) { - RETURN_FALSE; - } if (array_init(return_value) == FAILURE) { RETURN_FALSE; } - - while (last) { - zval *child; - child = php_domobject_new(last, &ret, NULL TSRMLS_CC); - add_next_index_zval(return_value, child); - last = last->next; + + if (last) { + while (last) { + zval *child; + child = php_domobject_new(last, &ret, NULL TSRMLS_CC); + add_next_index_zval(return_value, child); + last = last->next; + } } } /* }}} */ |