X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/46e3d846747a8ed50b2fd29d1e162432fca38e7d..3cfffc2258621558e1147ceaf63980a7f6ed414b:/lib/gpx.rb 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