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
1 changed files with 5 additions and 0 deletions
|
@ -80,6 +80,11 @@ class LicenseImporter extends ItemImporter
|
|||
$checkout_target = $this->item['checkout_target'];
|
||||
$asset = Asset::where('asset_tag', $asset_tag)->first();
|
||||
$targetLicense = $license->freeSeat();
|
||||
|
||||
if (is_null($targetLicense)){
|
||||
return;
|
||||
}
|
||||
|
||||
if ($checkout_target) {
|
||||
$targetLicense->assigned_to = $checkout_target->id;
|
||||
$targetLicense->user_id = Auth::id();
|
||||
|
|
Loading…
Add table
Reference in a new issue