Correctly handle schedule task deletion and avoid errors; closes #2534

This commit is contained in:
Dane Everitt 2020-10-22 20:54:58 -07:00
parent e1fa6d4e55
commit 65d04d0c05
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 128 additions and 5 deletions

View file

@ -43,7 +43,7 @@ class ProcessScheduleService
public function handle(Schedule $schedule, bool $now = false)
{
/** @var \Pterodactyl\Models\Task $task */
$task = $schedule->tasks()->where('sequence_id', 1)->first();
$task = $schedule->tasks()->orderBy('sequence_id', 'asc')->first();
if (is_null($task)) {
throw new DisplayException(