mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix an error with downloadHeaders function
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user