Skip to content

Commit

Permalink
Merge pull request #186 from jryd/main
Browse files Browse the repository at this point in the history
fix: move string check/decode for data in payload
  • Loading branch information
freekmurze authored Apr 2, 2024
2 parents 7de9e7e + 85ebd0b commit 0c864b3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Recorders/JobRecorder/JobRecorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ protected function getJobProperties(): array
foreach ($payload as $key => $value) {
if (! in_array($key, ['job', 'data', 'displayName'])) {
$properties[$key] = $value;
}
}

if (is_string($payload['data'])) {
try {
$properties['data'] = json_decode($payload['data'], true, 512, JSON_THROW_ON_ERROR);
} catch (Exception $exception) {
}
}
try {
if (is_string($payload['data'])) {
$properties['data'] = json_decode($payload['data'], true, 512, JSON_THROW_ON_ERROR);
}
} catch (Exception $exception) {
}

if ($pushedAt = DateTime::createFromFormat('U.u', $payload->get('pushedAt', ''))) {
Expand Down

0 comments on commit 0c864b3

Please sign in to comment.