X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/57209683238197d4391103ba3ca4b295a70fbb0a..9b9e857b726d4a45af5e1b760ac1639cd31f0280:/lib/gpx.rb?ds=sidebyside diff --git a/lib/gpx.rb b/lib/gpx.rb index 1bf7764ec..45a4dcf5f 100644 --- a/lib/gpx.rb +++ b/lib/gpx.rb @@ -27,7 +27,7 @@ module GPX point.timestamp = Time.parse(reader.read_string).utc end when XML::Reader::TYPE_END_ELEMENT - if reader.name == "trkpt" && point && point.valid? + if reader.name == "trkpt" && point&.valid? point.altitude ||= 0 yield point @actual_points += 1