Don't crash if attempting to import with an invalid password type.
This commit is contained in:
parent
6b16e4d606
commit
1c45a0df4a
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user