Merge pull request #12473 from inietov/fixes/rollbar_attempt_to_read_property_on_null

Fixed ErrorException:  Attempt to read property "id" on null [sc-19855]
This commit is contained in:
snipe 2023-02-15 12:32:53 -08:00 committed by GitHub
commit 057f0be20a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,6 +60,7 @@ class ActionlogsTransformer
if ($actionlog->action_type == 'accepted') {
$file_url = route('log.storedeula.download', ['filename' => $actionlog->filename]);
} else {
if ($actionlog->item) {
if ($actionlog->itemType() == 'asset') {
$file_url = route('show/assetfile', ['assetId' => $actionlog->item->id, 'fileId' => $actionlog->id]);
} elseif ($actionlog->itemType() == 'license') {
@ -69,6 +70,7 @@ class ActionlogsTransformer
}
}
}
}
$array = [
'id' => (int) $actionlog->id,