aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index a7c0d176..c36a2e35 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -2426,11 +2426,14 @@
* Invoked when the current connection needs a password from the Keychain.
*/
- (NSString *)keychainPasswordForConnection:(MCPConnection *)connection
-{
- SPKeychain *keychain = [[SPKeychain alloc] init];
+{
+ // If no keychain item is available, return an empty password
+ if (![connectionController connectionKeychainItemName]) return @"";
+
+ // Otherwise, pull the password from the keychain using the details from this connection
+ SPKeychain *keychain = [[SPKeychain alloc] init];
NSString *password = [keychain getPasswordForName:[connectionController connectionKeychainItemName] account:[connectionController connectionKeychainItemAccount]];
-
[keychain release];
return password;