Skip to content

Commit 6a2754e

Browse files
Merge pull request #1053 from RegoNoShi/fix/XMPPCoreDataStorage_persistent_store_directory_handling
Fixed persistent store directory handling when legacyPersistentStoreD…
2 parents 5e6227b + 2efe2dc commit 6a2754e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Extensions/CoreDataStorage/XMPPCoreDataStorage.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,11 @@ - (NSString *)persistentStoreDirectory
452452
// Previously the Peristent Story Directory was based on the Bundle Display Name but this can be Localized
453453
// If Peristent Story Directory already exists we will use that
454454
NSString *bundleDisplayName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
455-
NSString *legacyPersistentStoreDirectory = [basePath stringByAppendingPathComponent:bundleDisplayName];
456-
if ([fileManager fileExistsAtPath:legacyPersistentStoreDirectory]) {
457-
return legacyPersistentStoreDirectory;
455+
if (bundleDisplayName) {
456+
NSString *legacyPersistentStoreDirectory = [basePath stringByAppendingPathComponent:bundleDisplayName];
457+
if ([fileManager fileExistsAtPath:legacyPersistentStoreDirectory]) {
458+
return legacyPersistentStoreDirectory;
459+
}
458460
}
459461

460462
// Peristent Story Directory now uses the Bundle Identifier

0 commit comments

Comments
 (0)