Skip to content

Commit

Permalink
Avoid fatal error in match table generation
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Apr 4, 2024
1 parent 1fcffca commit 4122d3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Classes/MatchGeneration/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2009-2021 Rene Nitzsche ([email protected])
* (c) 2009-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -111,6 +111,10 @@ private function findKeyString($teams)
*/
private function createTable($teams, $table, $options)
{
$ret = [];
if (empty($teams)) {
return $ret;
}
$option_halfseries = isset($options['halfseries']) ? intval($options['halfseries']) : 0;
$option_nomatch = isset($options['nomatch']) ? intval($options['nomatch']) : 0;
// Alle Elemente einen Indexplatz hochschieben, damit die Team-Nr stimmt.
Expand All @@ -121,7 +125,6 @@ private function createTable($teams, $table, $options)
// Zählung des Spieltags
$dayCnt = isset($options['firstmatchday']) ? intval($options['firstmatchday']) : 0;

$ret = [];
// die Hinrunde hinzufügen
if (2 != $option_halfseries) {
foreach ($table as $day => $matches) {
Expand Down
4 changes: 3 additions & 1 deletion Classes/Model/Competition.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,9 @@ public function getTeams($ignoreDummies = true)
*/
public function getTeamIds()
{
return Strings::intExplode(',', $this->getProperty('teams'));
$teamIds = $this->getProperty('teams');

return $teamIds ? Strings::intExplode(',', $teamIds) : [];
}

/**
Expand Down

0 comments on commit 4122d3c

Please sign in to comment.