Explorar o código

another 'guard let self'

B. Petersen %!s(int64=5) %!d(string=hai) anos
pai
achega
03bb850679
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      deltachat-ios/Handler/DeviceContactsHandler.swift

+ 4 - 3
deltachat-ios/Handler/DeviceContactsHandler.swift

@@ -86,14 +86,15 @@ class DeviceContactsHandler {
             contactListDelegate?.accessDenied()
         case .restricted, .notDetermined:
             store.requestAccess(for: .contacts) { [weak self] granted, _ in
+                guard let self = self else { return }
                 if granted {
                     DispatchQueue.main.async {
-                        self?.addContactsToCore()
-                        self?.contactListDelegate?.accessGranted()
+                        self.addContactsToCore()
+                        self.contactListDelegate?.accessGranted()
                     }
                 } else {
                     DispatchQueue.main.async {
-                        self?.contactListDelegate?.accessDenied()
+                        self.contactListDelegate?.accessDenied()
                     }
                 }
             }