Fixing null child reference issue in XML

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4461 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-02-06 17:19:11 +00:00
parent a175687bd5
commit 709e257707

View file

@ -505,6 +505,8 @@ class XMLNode extends Object {
*
*/
function &child($id) {
$null = null;
if(is_int($id)) {
if(isset($this->children[$id])) {
return $this->children[$id];
@ -517,9 +519,9 @@ class XMLNode extends Object {
return $this->children[$i];
}
}
return null;
return $null;
} else {
return null;
return $null;
}
}
/**