aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-04-18 19:10:42 +0000
committerrowanbeentje <rowan@beent.je>2009-04-18 19:10:42 +0000
commita91db057f3d376002184ee737198932f40ee57e1 (patch)
tree16d7646715a9f92956db0cf26d42cd26e018f83a
parent5b6eac97ab61f38afca00659ca0353c3455bebd2 (diff)
downloadsequelpro-a91db057f3d376002184ee737198932f40ee57e1.tar.gz
sequelpro-a91db057f3d376002184ee737198932f40ee57e1.tar.bz2
sequelpro-a91db057f3d376002184ee737198932f40ee57e1.zip
- Ensure that arrays and dictionaries from prefs which are being upgraded are mutable
-rw-r--r--Source/SPPreferenceController.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m
index 80f32e36..8ea4e7f0 100644
--- a/Source/SPPreferenceController.m
+++ b/Source/SPPreferenceController.m
@@ -187,14 +187,14 @@
// For versions prior to r567 (0.9.5), add a timestamp-based identifier to favorites and keychain entries
if (recordedVersionNumber < 567 && [prefs objectForKey:@"favorites"]) {
int i;
- NSMutableArray *favoritesArray = [prefs objectForKey:@"favorites"];
+ NSMutableArray *favoritesArray = [NSMutableArray arrayWithArray:[prefs objectForKey:@"favorites"]];
NSMutableDictionary *favorite;
NSString *password, *keychainName, *keychainAccount;
KeyChain *upgradeKeychain = [[KeyChain alloc] init];
// Cycle through the favorites, generating a timestamp-derived ID for each and renaming associated keychain items.
for (i = 0; i < [favoritesArray count]; i++) {
- favorite = [favoritesArray objectAtIndex:i];
+ favorite = [NSMutableDictionary dictionaryWithDictionary:[favoritesArray objectAtIndex:i]];
if ([favorite objectForKey:@"id"]) continue;
[favorite setObject:[NSNumber numberWithInt:[[NSString stringWithFormat:@"%f", [[NSDate date] timeIntervalSince1970]] hash]] forKey:@"id"];
keychainName = [NSString stringWithFormat:@"Sequel Pro : %@", [favorite objectForKey:@"name"]];