Fixed:
if(!$result)
	$result = array();