From 2b3fb2fa9ad8ff57363692b2533579d77e676f79 Mon Sep 17 00:00:00 2001 From: Ivan Sein Date: Mon, 18 Nov 2019 17:17:39 +0100 Subject: [PATCH] Check if there are server capabilities before deleting account. Signed-off-by: Ivan Sein --- VideoCalls/NCDatabaseManager.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VideoCalls/NCDatabaseManager.m b/VideoCalls/NCDatabaseManager.m index e2df3daa..c8e78856 100644 --- a/VideoCalls/NCDatabaseManager.m +++ b/VideoCalls/NCDatabaseManager.m @@ -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]; }