diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/TableDocument.m | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 6a769996..3c02e687 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -390,13 +390,13 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum if (![self selectedFavorite]) return; - [nameField setStringValue:[self valueForKeyPath:@"selectedFavorite.name"]]; - [hostField setStringValue:[self valueForKeyPath:@"selectedFavorite.host"]]; - [socketField setStringValue:[self valueForKeyPath:@"selectedFavorite.socket"]]; - [userField setStringValue:[self valueForKeyPath:@"selectedFavorite.user"]]; - [portField setStringValue:[self valueForKeyPath:@"selectedFavorite.port"]]; - [databaseField setStringValue:[self valueForKeyPath:@"selectedFavorite.database"]]; - [passwordField setStringValue:[self selectedFavoritePassword]]; + [nameField setStringValue:([self valueForKeyPath:@"selectedFavorite.name"] ? [self valueForKeyPath:@"selectedFavorite.name"] : @"")]; + [hostField setStringValue:([self valueForKeyPath:@"selectedFavorite.host"] ? [self valueForKeyPath:@"selectedFavorite.host"] : @"")]; + [userField setStringValue:([self valueForKeyPath:@"selectedFavorite.user"] ? [self valueForKeyPath:@"selectedFavorite.user"] : @"")]; + [passwordField setStringValue:([self selectedFavoritePassword] ? [self selectedFavoritePassword] : @"")]; + [databaseField setStringValue:([self valueForKeyPath:@"selectedFavorite.database"] ? [self valueForKeyPath:@"selectedFavorite.database"] : @"")]; + [socketField setStringValue:([self valueForKeyPath:@"selectedFavorite.socket"] ? [self valueForKeyPath:@"selectedFavorite.socket"] : @"")]; + [portField setStringValue:([self valueForKeyPath:@"selectedFavorite.port"] ? [self valueForKeyPath:@"selectedFavorite.port"] : @"")]; [prefs setInteger:[favoritesController selectionIndex] forKey:@"LastFavoriteIndex"]; } |