From a7bd92c61f39e374b2a06052f3bb8e16e403a7fc Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Mon, 6 Feb 2017 11:17:56 +0800 Subject: [PATCH] check if git repository is existed before load --- pass/PasswordStore.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pass/PasswordStore.swift b/pass/PasswordStore.swift index c441b96..3fa0f74 100644 --- a/pass/PasswordStore.swift +++ b/pass/PasswordStore.swift @@ -53,7 +53,9 @@ class PasswordStore { private init() { do { - try storeRepository = GTRepository.init(url: storeURL) + if FileManager.default.fileExists(atPath: storeURL.path) { + try storeRepository = GTRepository.init(url: storeURL) + } } catch { print(error) }