mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 04:03:34 -08:00
Merge pull request #12470 from inietov/fixes/rollbar_16883_attempt_assign_on_null
Fixed Rollbar 16883 Error: Attempt to assign property "assigned_to" on null
This commit is contained in:
commit
bfac0fc811
|
@ -80,6 +80,11 @@ class LicenseImporter extends ItemImporter
|
||||||
$checkout_target = $this->item['checkout_target'];
|
$checkout_target = $this->item['checkout_target'];
|
||||||
$asset = Asset::where('asset_tag', $asset_tag)->first();
|
$asset = Asset::where('asset_tag', $asset_tag)->first();
|
||||||
$targetLicense = $license->freeSeat();
|
$targetLicense = $license->freeSeat();
|
||||||
|
|
||||||
|
if (is_null($targetLicense)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($checkout_target) {
|
if ($checkout_target) {
|
||||||
$targetLicense->assigned_to = $checkout_target->id;
|
$targetLicense->assigned_to = $checkout_target->id;
|
||||||
$targetLicense->user_id = Auth::id();
|
$targetLicense->user_id = Auth::id();
|
||||||
|
|
Loading…
Reference in a new issue