mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -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') {
|
||||
$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);
|
||||
if ($location) {
|
||||
$show_loc .= '"' .e($location->name). '"';
|
||||
|
|
Loading…
Reference in a new issue