diff --git a/composer.json b/composer.json index 5b8dbf7..818ec1f 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^7.1", + "php": "^7.1 || ^8.0", "myclabs/php-enum": "^1.7", "ext-iconv": "*" }, diff --git a/src/Readers/Pairtwo6.php b/src/Readers/Pairtwo6.php index 9a94d2b..d598f44 100644 --- a/src/Readers/Pairtwo6.php +++ b/src/Readers/Pairtwo6.php @@ -461,8 +461,8 @@ class Pairtwo6 implements ReaderInterface $offset += $length; $length = 1; - $player->Category = - $this->Tournament->Categories[ $this->readData('Int', substr($swscontents, $offset, $length)) - 1 ]; + $categoryindex = $this->readData('Int', substr($swscontents, $offset, $length)); + $player->Category = $categoryindex != 0 ? $this->Tournament->Categories[ $categoryindex ] : NULL; $offset += $length; $length = 1;