Skip to content

Commit

Permalink
Fix error if Steam returns empty response
Browse files Browse the repository at this point in the history
Querying the API for a Steam user who hastheir gameplay history private returns:
`"response": {}`
which results in the error:
`Undefined property: stdClass::$total_count in Player.php on line 120`
  • Loading branch information
ilumos committed Nov 15, 2018
1 parent 98c2f37 commit 10998f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Syntax/SteamApi/Steam/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function GetRecentlyPlayedGames($count = null)
// Get the client
$client = $this->getServiceResponse($arguments);

if ($client->total_count > 0) {
if (isset($client->total_count) && $client->total_count > 0) {
// Clean up the games
$games = $this->convertToObjects($client->games);

Expand Down

0 comments on commit 10998f3

Please sign in to comment.