]> git.openstreetmap.org Git - rails.git/blobdiff - lib/gpx.rb
Only report traces as offline when they are offline
[rails.git] / lib / gpx.rb
index 0aa23ae0b026eddc1af146780a56ff982ce14364..1212db6423deadeaa62fca89cfd674b8b5a39646 100644 (file)
@@ -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