|
@@ -765,12 +765,16 @@ class NCManageDatabase: NSObject {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- func getDirectoryID(_ serverUrl: String) -> String? {
|
|
|
+ func getDirectoryID(_ serverUrl: String?) -> String? {
|
|
|
|
|
|
guard let tableAccount = self.getAccountActive() else {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+ guard let serverUrl = serverUrl else {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+
|
|
|
let realm = try! Realm()
|
|
|
|
|
|
guard let result = realm.objects(tableDirectory.self).filter("account = %@ AND serverUrl = %@", tableAccount.account,serverUrl).first else {
|
|
@@ -780,12 +784,16 @@ class NCManageDatabase: NSObject {
|
|
|
return result.directoryID
|
|
|
}
|
|
|
|
|
|
- func getServerUrl(_ directoryID: String) -> String? {
|
|
|
+ func getServerUrl(_ directoryID: String?) -> String? {
|
|
|
|
|
|
guard let tableAccount = self.getAccountActive() else {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+ guard let directoryID = directoryID else {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+
|
|
|
let realm = try! Realm()
|
|
|
|
|
|
guard let result = realm.objects(tableDirectory.self).filter("account = %@ AND directoryID = %@", tableAccount.account, directoryID).first else {
|