From f6873889d5606314b2141fd49b42ea74c0a2e3dc Mon Sep 17 00:00:00 2001 From: Himalaya Pal <45174860+palhimalaya@users.noreply.github.com> Date: Thu, 23 May 2024 14:29:59 +0545 Subject: [PATCH] Refactor prepare_parameters method to handle nil parameters (#387) --- lib/public_activity/renderable.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/public_activity/renderable.rb b/lib/public_activity/renderable.rb index ec2174e..20bb8ee 100644 --- a/lib/public_activity/renderable.rb +++ b/lib/public_activity/renderable.rb @@ -151,7 +151,11 @@ def prepare_layout(root, layout) end def prepare_parameters(params) - @prepared_params ||= self.parameters.with_indifferent_access.merge(params) + if self.parameters + @prepared_params ||= self.parameters.with_indifferent_access.merge(params) + else + @prepared_params ||= params + end end protected