diff --git a/src/MetaHash.php b/src/MetaHash.php index 0cc2f54..41e9159 100644 --- a/src/MetaHash.php +++ b/src/MetaHash.php @@ -324,7 +324,13 @@ private function query(string $url, string $method, array $params = []): array throw new RuntimeException('QueryTorrent Error: '.$response->getBody()->getContents()); } - return \json_decode($response->getBody()->getContents(), true); + $result = \json_decode($response->getBody()->getContents(), true); + + if ($result === null) { + throw new RuntimeException('QueryTorrent Error: Empty response'); + } + + return $result; } /**