Skip to content

Commit

Permalink
Accommodate nil values correctly in JSON param fetching (#1762)
Browse files Browse the repository at this point in the history
* Accommodate nil values correctly in JSON param fetching.

* Pull nil behavior further down the stack.
  • Loading branch information
stephendolan authored Dec 15, 2022
1 parent 1e101e9 commit c70b972
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lucky/params.cr
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,10 @@ class Lucky::Params
end

private def stringify_json_value(value : JSON::Any) : String
value.as_s? || value.to_json
if value.raw.nil?
""
else
value.as_s? || value.to_json
end
end
end

0 comments on commit c70b972

Please sign in to comment.