From b8edbd159ea97a0f5a7f18fbf85470f7e465b7e8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 17 Dec 2020 08:31:39 +0100 Subject: [PATCH] guard against mail account looses all accounts it is valid for --- api/src/Mail/Account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Mail/Account.php b/api/src/Mail/Account.php index f50b2ae0d8..79362af6f6 100644 --- a/api/src/Mail/Account.php +++ b/api/src/Mail/Account.php @@ -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,