From 1a9f7fc4c79e08c2d12e6a2693f95f7c786dafef Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 23 Dec 2025 18:20:59 +0100 Subject: [PATCH] Fix an error with downloadHeaders function --- app/Services/Binaries/BinariesService.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Services/Binaries/BinariesService.php b/app/Services/Binaries/BinariesService.php index 88ffa9b90..eeded940d 100644 --- a/app/Services/Binaries/BinariesService.php +++ b/app/Services/Binaries/BinariesService.php @@ -660,7 +660,7 @@ class BinariesService $headers = $nntp->getXOVER($this->first.'-'.$this->last); } - if (NNTPService::isError($headers)) { + if (NNTPService::isError($headers) || ! \is_array($headers)) { if ($partRepair) { return null; } @@ -675,9 +675,13 @@ class BinariesService $headers = $nntp->getXOVER($this->first.'-'.$this->last); $nntp->enableCompression(); - if (NNTPService::isError($headers)) { - $message = ((int) $headers->code === 0 ? 'Unknown error' : $headers->message); - $this->log("Code {$headers->code}: $message\nSkipping group: {$this->groupMySQL['name']}", __FUNCTION__, 'error'); + if (NNTPService::isError($headers) || ! \is_array($headers)) { + if (\is_object($headers) && isset($headers->code, $headers->message)) { + $message = ((int) $headers->code === 0 ? 'Unknown error' : $headers->message); + $this->log("Code {$headers->code}: $message\nSkipping group: {$this->groupMySQL['name']}", __FUNCTION__, 'error'); + } else { + $this->log("Unknown error\nSkipping group: {$this->groupMySQL['name']}", __FUNCTION__, 'error'); + } return null; }