From 184230e06826117b1d87241e3acdf19935470e8f Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Jan 2012 22:58:09 -0800 Subject: [PATCH] check count before foreach --- include/conversation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index d40b2ea7e8..f4432bfd97 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -918,8 +918,9 @@ function conv_sort($arr,$order) { $ret = array(); foreach($parents as $x) { $ret[] = $x; - foreach($x['children'] as $y) - $ret[] = $y; + if(count($x['children'])) + foreach($x['children'] as $y) + $ret[] = $y; } return $ret;