]> git.mxchange.org Git - friendica.git/commitdiff
check count before foreach
authorfriendica <info@friendica.com>
Tue, 3 Jan 2012 06:58:09 +0000 (22:58 -0800)
committerfriendica <info@friendica.com>
Tue, 3 Jan 2012 06:58:09 +0000 (22:58 -0800)
include/conversation.php

index d40b2ea7e8e6a0f28a66e7c0a318ca514f08edc8..f4432bfd977e1633ec534b81199162867c258b41 100644 (file)
@@ -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;