From df71cc208d3c5f39849036b236e8993f250b84b9 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Wed, 13 Apr 2022 15:55:37 +0200 Subject: [PATCH] BUGFIX: fixed undefined offset --- composer.json | 2 +- src/Readers/Pairtwo6.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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;