aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-03-27 15:02:03 +0000
committerstuconnolly <stuart02@gmail.com>2011-03-27 15:02:03 +0000
commitc7a4e604462e11bf26dc7b58645fa6429848e6fc (patch)
treee697cee2f1ee855757c2f96d14de47eff265d09c /Source
parent02f1dc76e83c25120395cf59c79712fa41292507 (diff)
downloadsequelpro-c7a4e604462e11bf26dc7b58645fa6429848e6fc.tar.gz
sequelpro-c7a4e604462e11bf26dc7b58645fa6429848e6fc.tar.bz2
sequelpro-c7a4e604462e11bf26dc7b58645fa6429848e6fc.zip
Fix a bug that caused an exception when launching with empty preferences (and thus favorites).
Diffstat (limited to 'Source')
-rw-r--r--Source/SPPreferencesUpgrade.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m
index bfdd0f47..a4e15c6b 100644
--- a/Source/SPPreferencesUpgrade.m
+++ b/Source/SPPreferencesUpgrade.m
@@ -316,7 +316,7 @@ void SPMigrateConnectionFavoritesData(void)
NSMutableArray *favorites = [[NSMutableArray alloc] initWithArray:[prefs objectForKey:SPOldFavoritesKey]];
// Change the last used favorite and default favorite's indexes to be ID based
- if (![prefs objectForKey:SPLastFavoriteID]) {
+ if (![prefs objectForKey:SPLastFavoriteID] && [favorites count]) {
NSInteger lastFavoriteIndex = [prefs integerForKey:@"LastFavoriteIndex"];
NSInteger defaultFavoriteIndex = [prefs integerForKey:SPDefaultFavorite];