diff --git a/LiveContainerUI/LCUtils.m b/LiveContainerUI/LCUtils.m index 0b7c521..293ed73 100644 --- a/LiveContainerUI/LCUtils.m +++ b/LiveContainerUI/LCUtils.m @@ -187,7 +187,17 @@ + (NSProgress *)signAppBundle:(NSURL *)path completionHandler:(void (^)(BOOL suc } ALTCertificate *cert = [[NSClassFromString(@"ALTCertificate") alloc] initWithP12Data:self.certificateData password:self.certificatePassword]; + if (!cert) { + error = [NSError errorWithDomain:NSBundle.mainBundle.bundleIdentifier code:1 userInfo:@{NSLocalizedDescriptionKey: @"Failed to create ALTCertificate"}]; + completionHandler(NO, error); + return nil; + } ALTProvisioningProfile *profile = [[NSClassFromString(@"ALTProvisioningProfile") alloc] initWithURL:profilePath]; + if (!profile) { + error = [NSError errorWithDomain:NSBundle.mainBundle.bundleIdentifier code:2 userInfo:@{NSLocalizedDescriptionKey: @"Failed to create ALTProvisioningProfile"}]; + completionHandler(NO, error); + return nil; + } ALTAccount *account = [NSClassFromString(@"ALTAccount") new]; ALTTeam *team = [[NSClassFromString(@"ALTTeam") alloc] initWithName:@"" identifier:@"" /*profile.teamIdentifier*/ type:ALTTeamTypeUnknown account:account];