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,