Skip to content

Commit

Permalink
Refactor prepare_parameters method to handle nil parameters (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
palhimalaya authored May 23, 2024
1 parent 1f49035 commit f687388
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/public_activity/renderable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f687388

Please sign in to comment.