Browse code

fix warning

Bernd Wurst authored on01/05/2020 11:40:08
Showing1 changed files
... ...
@@ -200,6 +200,9 @@ function get_max_mailboxquota($server, $oldquota)
200 200
     $server = (int) $server;
201 201
     $result = db_query("SELECT systemquota - (COALESCE(systemquota_used,0) + COALESCE(mailquota,0)) AS free FROM system.v_quota WHERE uid=:uid AND server=:server", array(":uid" => $uid, ":server" => $server));
202 202
     $item = $result->fetch();
203
+    if (! $item) {
204
+        return $oldquota - config('vmail_basequota');
205
+    }
203 206
     DEBUG("Free space: ".$item['free']." / Really: ".($item['free'] + ($oldquota - config('vmail_basequota'))));
204 207
     return max(0, $item['free'] + ($oldquota - config('vmail_basequota')));
205 208
 }