Skip to content

Commit 297a2e9

Browse files
committed
Return null instead
Signed-off-by: Andrew Welch <andrew@nystudio107.com>
1 parent f43416e commit 297a2e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/services/Transcode.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,12 @@ public function getFileInfo($filePath, $summary = false)
467467
Craft::info($ffprobeCmd, __METHOD__);
468468
$result = JsonHelper::decodeIfJson($shellOutput, true);
469469
Craft::info(print_r($result, true), __METHOD__);
470-
470+
// Handle the case it not being JSON
471+
if (!is_array($result)) {
472+
$result = null;
473+
}
471474
// Trim down the arrays to just a summary
472-
if ($summary && !empty($result) && is_array($result)) {
475+
if ($summary && !empty($result)) {
473476
$summaryResult = [];
474477
foreach ($result as $topLevelKey => $topLevelValue) {
475478
switch ($topLevelKey) {

0 commit comments

Comments
 (0)