From 077e046a0e81cabcd72b2bbaf0983f57ca31d58c Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Tue, 13 Jun 2017 21:21:46 -0700 Subject: [PATCH] Fix a bug caused by NSPredicate mistake --- pass/Models/PasswordStore.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pass/Models/PasswordStore.swift b/pass/Models/PasswordStore.swift index 85b89dc..e96976e 100644 --- a/pass/Models/PasswordStore.swift +++ b/pass/Models/PasswordStore.swift @@ -213,7 +213,7 @@ class PasswordStore { func getPasswordEntity(by path: String, isDir: Bool) -> PasswordEntity? { let passwordEntityFetchRequest = NSFetchRequest(entityName: "PasswordEntity") do { - passwordEntityFetchRequest.predicate = NSPredicate(format: "path = %@ and isDir = %@", path, isDir.description) + passwordEntityFetchRequest.predicate = NSPredicate(format: "path = %@ and isDir = %@", path, isDir as NSNumber) return try context.fetch(passwordEntityFetchRequest).first as? PasswordEntity } catch { fatalError("Failed to fetch password entities: \(error)")