X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a1a6c577e8f406c0d0fa31326209c98ebd78954d..9fc2a5c4e9c2d0bc7df5493b5b74345992aa9dfa:/lib/gpx.rb?ds=sidebyside diff --git a/lib/gpx.rb b/lib/gpx.rb index 3e1cb9afa..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 @@ -57,7 +57,7 @@ module GPX when "application/x-bzip" then io = Bzip2::FFI::Reader.open(@file) end - parse_file(XML::Reader.io(io), &block) + parse_file(XML::Reader.io(io, :options => XML::Parser::Options::NOERROR), &block) end end