2
0

Don't crash if attempting to import with an invalid password type.

This commit is contained in:
Maarten Billemont 2014-10-26 10:54:28 -04:00
parent 6b16e4d606
commit 1c45a0df4a

View File

@ -723,6 +723,10 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted );
// Create new site. // Create new site.
NSString *typeEntityName = [MPAlgorithmForVersion( version ) classNameOfType:type]; 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]; MPSiteEntity *site = [NSEntityDescription insertNewObjectForEntityForName:typeEntityName inManagedObjectContext:context];
site.name = siteName; site.name = siteName;
site.loginName = loginName; site.loginName = loginName;