Fixed Undefined variable user in $backto if checked out to a non-user

Fixes [ch9194]
This commit is contained in:
snipe 2019-05-24 14:51:27 -07:00
parent 93bf541ce7
commit fcbc7e4540

View file

@ -93,7 +93,7 @@ class AssetCheckinController extends Controller
$data['model_name'] = $asset->model->name;
$data['model_number'] = $asset->model->model_number;
if ($backto=='user') {
if (($user) && ($backto =='user')) {
return redirect()->route("users.show", $user->id)->with('success', trans('admin/hardware/message.checkin.success'));
}
return redirect()->route("hardware.index")->with('success', trans('admin/hardware/message.checkin.success'));