mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Check for null company ID
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
81a982fd77
commit
279e6c7e4f
|
@ -91,7 +91,8 @@ class AssetCheckoutController extends Controller
|
||||||
|
|
||||||
$settings = \App\Models\Setting::getSettings();
|
$settings = \App\Models\Setting::getSettings();
|
||||||
|
|
||||||
if ($settings->full_multiple_companies_support){
|
// We have to check whether $target->company_id is null here since locations don't have a company yet
|
||||||
|
if (($settings->full_multiple_companies_support) && ((!is_null($target->company_id)) && (!is_null($asset->company_id)))) {
|
||||||
if ($target->company_id != $asset->company_id){
|
if ($target->company_id != $asset->company_id){
|
||||||
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('general.error_user_company'));
|
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('general.error_user_company'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue