X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/399ade116adb8250bbf92efa8dfeb3ca1090c7e4..26cbdcf71a68d5515c91bf9cb4ec958ce90c2647:/lib/gpx.rb?ds=sidebyside diff --git a/lib/gpx.rb b/lib/gpx.rb index 0aa23ae0b..1212db642 100644 --- a/lib/gpx.rb +++ b/lib/gpx.rb @@ -51,7 +51,7 @@ module GPX rescue Archive::Error io = ::File.open(@file) - case MimeMagic.by_magic(io).type + case MimeMagic.by_magic(io)&.type when "application/gzip" then io = Zlib::GzipReader.open(@file) when "application/x-bzip" then io = Bzip2::FFI::Reader.open(@file) end