Skip to content

Commit a3b46f6

Browse files
author
Edmandie Samonte
committed
lastlogoff is not always present. Handle that type of scenario.
1 parent 02d48bf commit a3b46f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Syntax/SteamApi/Containers/Player.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct($player)
5555
$this->communityVisibilityState = $player->communityvisibilitystate;
5656
$this->profileState = $this->checkIssetField($player, 'profilestate');
5757
$this->personaName = $player->personaname;
58-
$this->lastLogoff = date('F jS, Y h:ia', $player->lastlogoff);
58+
$this->lastLogoff = isset($player->lastlogoff) ? date('F jS, Y h:ia', $player->lastlogoff) : null;
5959
$this->profileUrl = $player->profileurl;
6060
$this->avatar = $this->getImageForAvatar($player->avatar);
6161
$this->avatarMedium = $this->getImageForAvatar($player->avatarmedium);

0 commit comments

Comments
 (0)