Fixed custom report bug if assignedTo has no value

This commit is contained in:
snipe 2017-11-06 10:42:34 -08:00
parent 4818e1b8ca
commit 936ff707c7

View file

@ -582,10 +582,15 @@ class ReportsController extends Controller
if (e(Input::get('username')) == '1') {
// Only works if we're checked out to a user, not anything else.
if ($asset->checkedOutToUser()) {
if ($asset->assignedto) {
$row[] = '"' .e($asset->assignedto->username). '"';
} else {
$row[] = ''; // Empty string if unassigned
}
} else {
$row[] = ''; // Empty string if unassigned
}
}
if (e(Input::get('employee_num')) == '1') {