mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Check that the user exists before trying to get location id
This commit is contained in:
parent
fc07753a5c
commit
0a218a37d0
|
@ -518,7 +518,7 @@ class ReportsController extends Controller
|
||||||
}
|
}
|
||||||
if (e(Input::get('location')) == '1') {
|
if (e(Input::get('location')) == '1') {
|
||||||
$show_loc = '';
|
$show_loc = '';
|
||||||
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id !='' )) {
|
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser) && ( $asset->assigneduser->location_id !='' )) {
|
||||||
$location = Location::find($asset->assigneduser->location_id);
|
$location = Location::find($asset->assigneduser->location_id);
|
||||||
if ($location) {
|
if ($location) {
|
||||||
$show_loc .= '"' .e($location->name). '"';
|
$show_loc .= '"' .e($location->name). '"';
|
||||||
|
|
Loading…
Reference in a new issue