Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix undefined 'achievements' property access in Steam stats response
  • Loading branch information
adamPacz committed May 27, 2025
commit 8b470529b25bbbb7b7620ac9c5da288b2ce99abf
8 changes: 8 additions & 0 deletions src/Syntax/SteamApi/Steam/User/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ public function GetGlobalAchievementPercentagesForApp($gameId)
// Get the client
$client = $this->setUpClient($arguments)->achievementpercentages;

if (!is_object($client) || !property_exists($client, 'achievements')) {
return [];
}

return $client->achievements;
}

Expand Down Expand Up @@ -142,6 +146,10 @@ public function GetUserStatsForGame($appId, $all = false)
return $client;
}

if (!is_object($client) || !property_exists($client, 'achievements')) {
return [];
}

return $client->achievements;
}

Expand Down