check if git repository is existed before load

This commit is contained in:
Bob Sun 2017-02-06 11:17:56 +08:00
parent d3f186013e
commit a7bd92c61f
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -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)
}