diff --git a/src/Broadcaster/Scheduler.php b/src/Broadcaster/Scheduler.php index 6d7e1e3..e7d00ad 100644 --- a/src/Broadcaster/Scheduler.php +++ b/src/Broadcaster/Scheduler.php @@ -165,13 +165,17 @@ protected function getRunningBroadcasts(): array $processStrings = $this->schedulerCommands->getRunningProcesses(); foreach ($processStrings as $processString) { + $broadcastId = $this->schedulerCommands->getBroadcastId($processString); + $processId = $this->schedulerCommands->getProcessId($processString); + $channelId = $this->schedulerCommands->getChannelId($processString); + $environment = $this->schedulerCommands->getEnvironment($processString); + try { - $runningItem = new RunningBroadcast( - $this->schedulerCommands->getBroadcastId($processString), - $this->schedulerCommands->getProcessId($processString), - $this->schedulerCommands->getChannelId($processString), - $this->schedulerCommands->getEnvironment($processString) - ); + if (!is_int($broadcastId) || !is_int($processId) || !is_int($channelId)) { + throw new \Exception('Invalid process string'); + } + + $runningItem = new RunningBroadcast($broadcastId, $processId, $channelId, $environment); if ($runningItem->isValid($this->schedulerCommands->getKernelEnvironment())) { $runningBroadcasts[] = $runningItem;