NSURL *outputLogFile = [[HBUtilities appSupportURL] URLByAppendingPathComponent:@"HandBrake-activitylog.txt"];
_outputFile = [[HBOutputFileWriter alloc] initWithFileURL:outputLogFile];
- [[HBOutputRedirect stderrRedirect] addListener:_outputFile];
- [[HBOutputRedirect stdoutRedirect] addListener:_outputFile];
+ if (_outputFile)
+ {
+ [[HBOutputRedirect stderrRedirect] addListener:_outputFile];
+ [[HBOutputRedirect stdoutRedirect] addListener:_outputFile];
+ }
// We initialize the outputTextStorage object for the activity window
outputTextStorage = [[NSTextStorage alloc] init];
// Tell HB to output a new activity log file for this encode
self.currentLog = [[HBJobOutputFileWriter alloc] initWithJob:nextJob];
- [[HBOutputRedirect stderrRedirect] addListener:self.currentLog];
- [[HBOutputRedirect stdoutRedirect] addListener:self.currentLog];
+ if (self.currentLog)
+ {
+ [[HBOutputRedirect stderrRedirect] addListener:self.currentLog];
+ [[HBOutputRedirect stdoutRedirect] addListener:self.currentLog];
+ }
self.currentJob = nextJob;
[self reloadQueueItemAtIndex:[self.jobs indexOfObject:nextJob]];