소스 검색

another 'guard let self'

B. Petersen 5 년 전
부모
커밋
03bb850679
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  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()
                     }
                 }
             }