Fix importing of GPX traces with a leading byte order marker
Fixes #2258
This commit is contained in:
parent
399ade116a
commit
26cbdcf71a
5 changed files with 16 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue