From 01e8e5d12a7bc2ced74701cf7ce6899d1ccf0cd8 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Mon, 1 May 2023 11:58:21 -0600 Subject: AƱade safe operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/products_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/api') diff --git a/app/controllers/api/products_controller.rb b/app/controllers/api/products_controller.rb index 59019d0..838a38a 100644 --- a/app/controllers/api/products_controller.rb +++ b/app/controllers/api/products_controller.rb @@ -68,7 +68,7 @@ module Api end def object_params - categories = permitted_params[:categories].split(',') + categories = permitted_params[:categories]&.split(',') public_id = SecureRandom.hex(12) public_id = SecureRandom.hex(12) while Product.exists?(public_id:) permitted_params.merge(categories:, public_id:) -- cgit v1.2.3