X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/46e3d846747a8ed50b2fd29d1e162432fca38e7d..f881a8c83c54da98e5c3058a48a1cde952b1be8a:/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