Skip to content

Commit

Permalink
fix(legacy): Avoid crash with lot of streams to present
Browse files Browse the repository at this point in the history
  • Loading branch information
mp3butcher committed Jan 25, 2024
1 parent dab6c48 commit 6a3295b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions legacy/application/controllers/PreferenceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ public function streamSettingAction()
$setting = Application_Model_StreamSetting::getStreamSetting();
$form->setSetting($setting);

if($num_of_stream > MAX_NUM_STREAMS) {
Logging::error('Your streams count ('.$num_of_stream.') exceed the maximum, some of them will not be displayed');
$num_of_stream = MAX_NUM_STREAMS;
}

for ($i = 1; $i <= $num_of_stream; ++$i) {
$subform = new Application_Form_StreamSettingSubForm();
$subform->setPrefix($i);
Expand Down

0 comments on commit 6a3295b

Please sign in to comment.