Skip to content

Commit

Permalink
Update GameSave.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dsbilling committed Jul 30, 2023
1 parent 5cd2bf3 commit 1db5246
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/Models/GameSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ public function getAchievements(): array
try {
$earnedAchievements = $this->getPlayerData('EarnedAchievements');

// Verify that it is a string
if (! is_string($earnedAchievements)) {
Log::error('EarnedAchievements is not a string');
Log::error($earnedAchievements);
Log::error('User ID: '.$this->user_id);

return [];
}

return explode(',', $earnedAchievements);
} catch (Exception $e) {
// If there is an error, return an empty array and log the error
Expand Down

0 comments on commit 1db5246

Please sign in to comment.