diff --git a/MasterPassword/ObjC/MPAppDelegate_Store.m b/MasterPassword/ObjC/MPAppDelegate_Store.m index 1d89941e..65c1aa5c 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Store.m +++ b/MasterPassword/ObjC/MPAppDelegate_Store.m @@ -723,6 +723,10 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); // Create new site. NSString *typeEntityName = [MPAlgorithmForVersion( version ) classNameOfType:type]; + if (!typeEntityName) { + err( @"Invalid site type in import file: %@ has type %lu", siteName, (long)type ); + return MPImportResultInternalError; + } MPSiteEntity *site = [NSEntityDescription insertNewObjectForEntityForName:typeEntityName inManagedObjectContext:context]; site.name = siteName; site.loginName = loginName;