summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-01-16 15:06:39 +0100
committerDamiano Galassi <[email protected]>2016-01-16 15:06:39 +0100
commited8c11eed00c9c4a1df895a42ae1b6d97bd1e66b (patch)
tree0aacb8e3198f8688de17e9cc2341f1e4fc1f7423
parente3d65a621c2c1facddd70dffcf26415782d13f72 (diff)
MacGui: check if the activity log is not nil before adding it to HBOutputRedirect.
-rw-r--r--macosx/HBOutputPanelController.m7
-rw-r--r--macosx/HBQueueController.m7
2 files changed, 10 insertions, 4 deletions
diff --git a/macosx/HBOutputPanelController.m b/macosx/HBOutputPanelController.m
index 654d9c85f..4b09f3cc4 100644
--- a/macosx/HBOutputPanelController.m
+++ b/macosx/HBOutputPanelController.m
@@ -52,8 +52,11 @@
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];
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m
index 537e8c86b..8c020539b 100644
--- a/macosx/HBQueueController.m
+++ b/macosx/HBQueueController.m
@@ -582,8 +582,11 @@
// 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]];