Skip to content

Commit d810475

Browse files
Merge pull request #6 from Ziggeo/patch
Prevent error on logging
2 parents d67f5bb + 5574a28 commit d810475

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

FfmpegVideoTranscoding.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public static function transcode($source, $options) {
173173
} catch (Exception $e) {
174174
throw new VideoTranscodingException(VideoTranscodingException::TRANSCODE_EXCEPTION, (string)$e);
175175
} finally {
176-
if (@$options["log"])
176+
if (@$options["log"] && @$video)
177177
print_r(implode(PHP_EOL, $video->getFinalCommand($format, $target)) . PHP_EOL);
178178
}
179179
if (@$options["faststart"] && $options["format"] == "mp4")
@@ -237,7 +237,7 @@ public static function extractAudio($source, $format, $options = array()) {
237237
} catch (Exception $e) {
238238
throw new VideoTranscodingException(VideoTranscodingException::TRANSCODE_EXCEPTION, (string)$e);
239239
} finally {
240-
if (@$options["log"])
240+
if (@$options["log"] && @$video)
241241
print_r(implode(PHP_EOL, $video->getFinalCommand($format, $target)) . PHP_EOL);
242242
}
243243
}

0 commit comments

Comments
 (0)