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;