Skip to content

Commit 5bae25a

Browse files
authored
Update Player.php
When a player's account is private and you call GetPlayerLevelDetails() the Containers\Player\Level class cannot be created because $details = $this->GetBadges(); will return empty and the Containers\Player\Level class constructor will fail. Why do I return NULL so I can just check if GetPlayerLevelDetails () returns NULL is meant there account is probably private.
1 parent 1ab2478 commit 5bae25a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Syntax/SteamApi/Steam/Player.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public function GetSteamLevel()
3434
public function GetPlayerLevelDetails()
3535
{
3636
$details = $this->GetBadges();
37+
38+
if(count((array)$details) == 0){
39+
return NULL;
40+
}
3741

3842
$details = new Level($details);
3943

0 commit comments

Comments
 (0)