From 742e183b02f955c6b2bb3b4238888935493439c7 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 4 Jan 2024 14:04:00 -0800 Subject: [PATCH] Add guard against adding null values to query Since $request->filled(null) returns true --- app/Http/Controllers/Api/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 89d02c8b62..f5168a5914 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -136,7 +136,7 @@ class AssetsController extends Controller // Search custom fields by column name foreach ($all_custom_fields as $field) { - if ($request->filled($field->db_column_name())) { + if ($request->filled($field->db_column_name()) && $field->db_column_name()) { $assets->where($field->db_column_name(), '=', $request->input($field->db_column_name())); } }