]> git.openstreetmap.org Git - rails.git/blobdiff - lib/gpx.rb
Merge remote-tracking branch 'upstream/pull/5377'
[rails.git] / lib / gpx.rb
index 1bf7764ec5e3052f878c394f4ae75f9e1c9e879c..45a4dcf5fc0bd62335ea0339409e2c1fbfd49e6d 100644 (file)
@@ -27,7 +27,7 @@ module GPX
             point.timestamp = Time.parse(reader.read_string).utc
           end
         when XML::Reader::TYPE_END_ELEMENT
             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
             point.altitude ||= 0
             yield point
             @actual_points += 1