mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03: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
@ -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 New Issue
Block a user