Skip to content

Commit a742418

Browse files
authored
Throw an exception on empty response
1 parent 09974ab commit a742418

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Syntax/SteamApi/Client.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ protected function sendRequest(Request $request)
199199
} catch (Exception $e) {
200200
throw new ApiCallFailedException($e->getMessage(), $e->getCode(), $e);
201201
}
202+
203+
// For some resources, the Steam API responds with an empty response
204+
if (empty($result->body)) {
205+
throw new ApiCallFailedException('API call failed due to empty response', $result->code);
206+
}
202207

203208
// If all worked out, return the result
204209
return $result;

0 commit comments

Comments
 (0)