Fix display of an empty or non-moderated list.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 16 Nov 2012 22:06:51 +0000 (23:06 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 16 Nov 2012 22:06:51 +0000 (23:06 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
modules/lists/lists.inc.php

index f167ab2..5d2b8f4 100644 (file)
@@ -43,9 +43,11 @@ function list_sort_owners($emails, $tri_promo = true)
 
     $pf = new ProfileFilter(new UFC_Email($emails));
     $it = $pf->iterProfiles();
-    while ($p = $it->next()) {
-        $members[$p->owner_id]['user']->setPrefetchedProfile($p);
-        $members[$p->owner_id]['profile'] = $p;
+    if ($it) {
+        while ($p = $it->next()) {
+            $members[$p->owner_id]['user']->setPrefetchedProfile($p);
+            $members[$p->owner_id]['profile'] = $p;
+        }
     }
 
     foreach ($emails as $email) {