Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid fatal error in match table generation #101

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading