Skip to content

Commit 56db102

Browse files
committed
Fix for profilestate field
profilestate field is not always present, so, exception is thrown when trying to get this property if it is absent.
1 parent fbc4873 commit 56db102

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Syntax/SteamApi/Containers/Player.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct($player)
5151
$this->steamId = $player->steamid;
5252
$this->steamIds = (new Id((int)$this->steamId));
5353
$this->communityVisibilityState = $player->communityvisibilitystate;
54-
$this->profileState = $player->profilestate;
54+
$this->profileState = $this->checkIssetField($player, 'profilestate');
5555
$this->personaName = $player->personaname;
5656
$this->lastLogoff = date('F jS, Y h:ia', $player->lastlogoff);
5757
$this->profileUrl = $player->profileurl;
@@ -92,4 +92,4 @@ protected function convertPersonaState($personaState)
9292
}
9393
}
9494

95-
}
95+
}

0 commit comments

Comments
 (0)