Check if there are server capabilities before deleting account.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2019-11-18 17:17:39 +01:00
Родитель 02888c2393
Коммит 2b3fb2fa9a
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -127,7 +127,9 @@
ServerCapabilities *serverCapabilities = [ServerCapabilities objectsWithPredicate:query].firstObject;
[realm beginWriteTransaction];
[realm deleteObject:removeAccount];
[realm deleteObject:serverCapabilities];
if (serverCapabilities) {
[realm deleteObject:serverCapabilities];
}
[realm commitWriteTransaction];
}