mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 14:09:43 -08:00
Merge pull request #12575 from inietov/fixes/typeError_get_class_argument_must_be_object_null_given
Fixed: TypeError: get_class(): Argument #1 ($object) must be of type object, null given
This commit is contained in:
commit
2ab0abc8a1
|
@ -59,6 +59,12 @@ class LicenseCheckinController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$license = License::find($licenseSeat->license_id);
|
$license = License::find($licenseSeat->license_id);
|
||||||
|
|
||||||
|
// LicenseSeat is not assigned, it can't be checked in
|
||||||
|
if (is_null($licenseSeat->assignedTo) && is_null($licenseSeat->asset_id)) {
|
||||||
|
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.checkin.error'));
|
||||||
|
}
|
||||||
|
|
||||||
$this->authorize('checkout', $license);
|
$this->authorize('checkout', $license);
|
||||||
|
|
||||||
if (! $license->reassignable) {
|
if (! $license->reassignable) {
|
||||||
|
|
|
@ -93,8 +93,12 @@ trait Loggable
|
||||||
{
|
{
|
||||||
$settings = Setting::getSettings();
|
$settings = Setting::getSettings();
|
||||||
$log = new Actionlog;
|
$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) {
|
if (static::class == LicenseSeat::class) {
|
||||||
$log->item_type = License::class;
|
$log->item_type = License::class;
|
||||||
|
|
Loading…
Reference in a new issue