]> git.localhorst.tv Git - alttp.git/commitdiff
fix div by zero
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 3 Feb 2026 14:48:16 +0000 (15:48 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 3 Feb 2026 14:48:16 +0000 (15:48 +0100)
app/Models/Tournament.php

index 4860fb4b1b8e2760e6806b241ab04b9b06106a05..c2636a395b728cc3af801a5ff200aebd06c9b2fe 100644 (file)
@@ -80,7 +80,7 @@ class Tournament extends Model {
                foreach ($runners as $entry) {
                        $result = $entry['runner'];
                        if ($this->total_scoring == 'avg') {
-                               $result->score = $entry['total'] / $entry['rounds'];
+                               $result->score = $entry['rounds'] ? $entry['total'] / $entry['rounds'] : 0;
                        } else {
                                $result ->score = $entry['total'];
                        }