[openstreetmap/openstreetmap-website] Use `where()` instead of `find()` to prevent RecordNotFound (PR #4203)
ENT8R
notifications at github.com
Sat Aug 26 11:01:51 UTC 2023
@ENT8R commented on this pull request.
> @@ -1,4 +1,4 @@
xml.instruct! :xml, :version => "1.0"
xml.osm(OSM::API.new.xml_root_attributes) do |osm|
- osm << render(@users)
+ osm << (render(@users) || "")
I think so, see also https://github.com/openstreetmap/openstreetmap-website/pull/2223#discussion_r300065590
If the set is empty, rendering fails with `ActionView::Template::Error: no implicit conversion of nil into String`, because `render()` returns nil in that case and trying to concatenate nil with an existing string will fail (but concatenating an empty string with another string works).
Regarding the JSON version, this is not an issue because no strings are concatenated there.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4203#discussion_r1306403015
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4203/review/1596841644 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230826/995079cb/attachment.htm>
More information about the rails-dev
mailing list