瀏覽代碼

Improvements

Marino Faggiana 7 年之前
父節點
當前提交
a18521356f
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      iOSClient/Database/NCManageDatabase.swift

+ 4 - 6
iOSClient/Database/NCManageDatabase.swift

@@ -213,13 +213,11 @@ class NCManageDatabase: NSObject {
         
         let realm = try! Realm()
         
-        let result = realm.objects(tableAccount.self).filter(predicate).first
-        
-        if result != nil {
-            return tableAccount.init(value: result!)
-        } else {
-            return nil
+        if let result = realm.objects(tableAccount.self).filter(predicate).first {
+            return tableAccount.init(value: result)
         }
+        
+        return nil
     }
     
     func getAccountAutoUploadFileName() -> String {