mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Avoid crash when user denies keychain access
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
4efebdaa52
commit
71d64a837e
1 changed files with 2 additions and 1 deletions
|
@ -523,7 +523,7 @@ impl platform::Platform for MacPlatform {
|
|||
let status = SecItemCopyMatching(attrs.as_concrete_TypeRef(), &mut result);
|
||||
match status {
|
||||
security::errSecSuccess => {}
|
||||
security::errSecItemNotFound => return None,
|
||||
security::errSecItemNotFound | security::errSecUserCanceled => return None,
|
||||
_ => panic!("reading password failed: {}", status),
|
||||
}
|
||||
|
||||
|
@ -657,6 +657,7 @@ mod security {
|
|||
}
|
||||
|
||||
pub const errSecSuccess: OSStatus = 0;
|
||||
pub const errSecUserCanceled: OSStatus = -128;
|
||||
pub const errSecItemNotFound: OSStatus = -25300;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue