Skip to content

Commit

Permalink
make sure array_key_first gets value
Browse files Browse the repository at this point in the history
  • Loading branch information
ferishili committed Feb 21, 2024
1 parent 8d3d37b commit 15ad73a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/local/output_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static function output_episode($ocinstanceid, $episodeid, $modinstanceid,
echo '<br>';

// Find aspect-ratio if there is only one video track.
if (count($data['streams']) === 1) {
if (count($data['streams']) === 1 && !empty($data['streams'][0]['sources'])) {
$sources = $data['streams'][0]['sources'];
$res = $sources[array_key_first($sources)][0]['res'];
$resolution = $res['w'] . '/' . $res['h'];
Expand Down

0 comments on commit 15ad73a

Please sign in to comment.