diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index dd9d0c7fad..5003ae924d 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -1179,6 +1179,9 @@ class AssetsController extends Controller $user = User::find(e(Input::get('assigned_to'))); $admin = Auth::user(); + if (!is_array(Input::get('selected_assets'))) { + return redirect()->route('hardware/bulkcheckout')->withInput()->with('error', trans('admin/hardware/message.checkout.no_assets_selected')); + } $asset_ids = array_filter(Input::get('selected_assets')); if ((Input::has('checkout_at')) && (Input::get('checkout_at')!= date("Y-m-d"))) { diff --git a/resources/lang/en/admin/hardware/message.php b/resources/lang/en/admin/hardware/message.php index 112cf77ded..e087cad26f 100644 --- a/resources/lang/en/admin/hardware/message.php +++ b/resources/lang/en/admin/hardware/message.php @@ -62,7 +62,8 @@ return array( 'error' => 'Asset was not checked out, please try again', 'success' => 'Asset checked out successfully.', 'user_does_not_exist' => 'That user is invalid. Please try again.', - 'not_available' => 'That asset is not available for checkout!' + 'not_available' => 'That asset is not available for checkout!', + 'no_assets_selected' => 'You must select at least one asset from the list' ), 'checkin' => array(