Do not fetch all companies if no id is provided.
authorStéphane Jacob <sj@m4x.org>
Tue, 29 Nov 2011 13:28:52 +0000 (14:28 +0100)
committerStéphane Jacob <sj@m4x.org>
Tue, 29 Nov 2011 13:29:08 +0000 (14:29 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
include/profilefields.inc.php

index ef574c0..263fcb5 100644 (file)
@@ -875,7 +875,7 @@ class CompanyList
 
     static public function get($id)
     {
-        if (!array_key_exists($id, self::$companies)) {
+        if (!is_null($id) && !array_key_exists($id, self::$companies)) {
             self::preload();
         }
         if (isset(self::$companies[$id])) {