mirror of
https://github.com/ppy/osu
synced 2025-03-05 02:49:30 +00:00
Hard bail on attempting to import an invalid archive format
This commit is contained in:
parent
4e4f3fc039
commit
f565cc861d
@ -13,6 +13,7 @@ using osu.Game.IO;
|
|||||||
using osu.Game.IO.Archives;
|
using osu.Game.IO.Archives;
|
||||||
using osu.Game.IPC;
|
using osu.Game.IPC;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
|
using SharpCompress.Common;
|
||||||
using FileInfo = osu.Game.IO.FileInfo;
|
using FileInfo = osu.Game.IO.FileInfo;
|
||||||
|
|
||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
@ -331,7 +332,9 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
if (ZipFile.IsZipFile(path))
|
if (ZipFile.IsZipFile(path))
|
||||||
return new ZipArchiveReader(Files.Storage.GetStream(path), Path.GetFileName(path));
|
return new ZipArchiveReader(Files.Storage.GetStream(path), Path.GetFileName(path));
|
||||||
return new LegacyFilesystemReader(path);
|
if (Directory.Exists(path))
|
||||||
|
return new LegacyFilesystemReader(path);
|
||||||
|
throw new InvalidFormatException($"{path} is not a valid archive");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user