diff --git a/MiscMerge/MiscMergeTemplate.m b/MiscMerge/MiscMergeTemplate.m index 30c13af5..9e8e3442 100755 --- a/MiscMerge/MiscMergeTemplate.m +++ b/MiscMerge/MiscMergeTemplate.m @@ -136,7 +136,7 @@ - (NSString *) contentsOfFileWithName:(NSString *)filename { encoding:NSUTF8StringEncoding error:&error]; - if (error != nil) { + if (fileString == nil) { NSLog(@"%@: Could not read template file %@ because %@", [self class], filename, [error localizedDescription]); } return fileString; diff --git a/mogenerator.m b/mogenerator.m index 56dad8e7..77808650 100644 --- a/mogenerator.m +++ b/mogenerator.m @@ -823,7 +823,7 @@ - (void)setModel:(NSString*)momOrXCDataModelFilePath { // Cool, the model is in the Xcode 4.0+ format, we can compile it ourselves. NSError *compileError = nil; momFilePath = [NSManagedObjectModel compileModelAtPath:momOrXCDataModelFilePath inDirectory:NSTemporaryDirectory() error:&compileError]; - if (compileError) { + if (momFilePath == nil) { NSLog(@"Error: %@", [compileError localizedDescription]); } assert(momFilePath);