mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Check if target is not null to retrieve the proper data
This commit is contained in:
parent
9d94bd6567
commit
0d860c0b72
|
@ -93,8 +93,12 @@ trait Loggable
|
|||
{
|
||||
$settings = Setting::getSettings();
|
||||
$log = new Actionlog;
|
||||
$log->target_type = get_class($target);
|
||||
$log->target_id = $target->id;
|
||||
|
||||
if($target != null){
|
||||
$log->target_type = get_class($target);
|
||||
$log->target_id = $target->id;
|
||||
|
||||
}
|
||||
|
||||
if (static::class == LicenseSeat::class) {
|
||||
$log->item_type = License::class;
|
||||
|
|
Loading…
Reference in a new issue