]> granicus.if.org Git - handbrake/commitdiff
MacGui: check if the activity log is not nil before adding it to HBOutputRedirect.
authorDamiano Galassi <damiog@gmail.com>
Sat, 16 Jan 2016 14:06:39 +0000 (15:06 +0100)
committerDamiano Galassi <damiog@gmail.com>
Sat, 16 Jan 2016 14:06:39 +0000 (15:06 +0100)
macosx/HBOutputPanelController.m
macosx/HBQueueController.m

index 654d9c85fafbac9be24ece9990ab1194c49bfd64..4b09f3cc42b611d39a1c926c382c265fc3be7e39 100644 (file)
         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];
index 537e8c86baa9d1c455973d1ce5c60c584151a53b..8c020539beb47ddf9bed4c62d347cfd653f7f00c 100644 (file)
 
             // 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]];