guard against mail account looses all accounts it is valid for

This commit is contained in:
Ralf Becker 2020-12-17 08:31:39 +01:00
parent 9cf16b7423
commit b8edbd159e

View File

@ -1218,7 +1218,7 @@ class Account implements \ArrayAccess
{
$old_account_ids[] = $row['account_id'];
}
if (($ids_to_remove = array_diff($old_account_ids, (array)$data['account_id'])))
if ($data['account_id'] && ($ids_to_remove = array_diff($old_account_ids, (array)$data['account_id'])))
{
self::$db->delete(self::VALID_TABLE, $where+array(
'account_id' => $ids_to_remove,