Closed Ragowit closed 1 year ago
If you can find the trophy with that issue that would be great. I tried iterating through all the trophies that user has but there's way too many. It's possible that it might be some super old trophy list that is missing that value for some reason.
It can have been some hiccup when I updated... Looking through the code right now to see if I get the error again.
np_communication_id: NPWR33147_00 group_id: default order_id: 0 account_id: 441308995318026967 earned_date: 2022-12-13 15:55:24 progress: earned: [errors out]
I have an if-check for earned before that seems to work. It stops working if I call it a second time?
Weird, this is the code I'm testing with, and it seems to be okay. I even tried calling earned
twice with no issues.
foreach ($account->trophyTitles() as $title)
{
if ($title->npCommunicationId() != 'NPWR33147_00')
{
continue;
}
$groups = $title->trophyGroups();
foreach ($groups as $group)
{
foreach ($group->trophies() as $trophy)
{
if ($trophy->earned())
{
var_dump($trophy->earned());
}
}
}
die('hit it');
}
Well, I updated my code with $trophyEarned = $trophy->earned();
and then use the $trophyEarned
instead. Seems to have solved my issue.
Dunno why.
I know the profile is HETARE69 but don't have specific game or trophy yet.