From: friendica Date: Tue, 3 Jan 2012 06:58:09 +0000 (-0800) Subject: check count before foreach X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=184230e06826117b1d87241e3acdf19935470e8f;p=friendica.git check count before foreach --- 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;