Bug #8759: Don't add special folders to folder list if they don't exist
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 8 Dec 2009 21:18:15 +0000 (14:18 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 8 Dec 2009 21:18:15 +0000 (14:18 -0700)
imp/ajax.php

index 0c33dc0..3a797d6 100644 (file)
@@ -338,8 +338,9 @@ case 'ListFolders':
             }
 
             foreach ($val as $val2) {
-                if (!isset($folder_list[$val2])) {
-                    $folder_list[$val2] = $imptree->element($val2);
+                if (!isset($folder_list[$val2]) &&
+                    ($elt = $imptree->element($val2))) {
+                    $folder_list[$val2] = $elt;
                 }
             }
         }