Merge pull request #14299 from snipe/fixes/fix_crash_on_purged_models_in_activity_report

Check that the model exists before trying to access properties
This commit is contained in:
snipe 2024-02-19 15:36:44 +00:00 committed by GitHub
commit 1e351b4d63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -296,8 +296,8 @@ class ReportsController extends Controller
e($actionlog->itemType()),
($actionlog->itemType() == 'user') ? $actionlog->filename : $item_name,
($actionlog->item) ? $actionlog->item->serial : null,
($actionlog->item->model) ? htmlspecialchars($actionlog->item->model->name, ENT_NOQUOTES) : null,
($actionlog->item->model) ? $actionlog->item->model->model_number : null,
(($actionlog->item) && ($actionlog->item->model)) ? htmlspecialchars($actionlog->item->model->name, ENT_NOQUOTES) : null,
(($actionlog->item) && ($actionlog->item->model)) ? $actionlog->item->model->model_number : null,
$target_name,
($actionlog->note) ? e($actionlog->note) : '',
$actionlog->log_meta,