Skip to content

Commit

Permalink
Fix saving blank passwords in Keychain
Browse files Browse the repository at this point in the history
  • Loading branch information
tagavari committed Aug 3, 2022
1 parent 8369086 commit c0e9b16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion AirMessage/Helper/PreferencesManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ class PreferencesManager {

private func setValue(_ value: String, for account: KeychainAccount) throws {
try runOnMain {
try KeychainManager.setValue(value, for: account.rawValue)
if value.isEmpty {
try KeychainManager.removeValue(for: account.rawValue)
} else {
try KeychainManager.setValue(value, for: account.rawValue)
}
keychainValues[account.rawValue] = value
}
}
Expand Down

0 comments on commit c0e9b16

Please sign in to comment.