Skip to content

Commit

Permalink
Do the same check as in setDefaultStoreCoordinator so it won't crash …
Browse files Browse the repository at this point in the history
…if no persistent stores exists
  • Loading branch information
flambert committed Apr 3, 2013
1 parent 477049d commit cb46ba3
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -217,7 +217,7 @@ - (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSStrin
[self unlock];

dispatch_async(dispatch_get_main_queue(), ^{
if ([NSPersistentStore MR_defaultPersistentStore] == nil)
if ([[self persistentStores] count] && [NSPersistentStore MR_defaultPersistentStore] == nil)
{
[NSPersistentStore MR_setDefaultPersistentStore:[[self persistentStores] objectAtIndex:0]];
}
Expand Down

0 comments on commit cb46ba3

Please sign in to comment.