Merge pull request #1026 from peppy/beatmap-delete-fixes

Fix crashes related to deleting/importing beatmaps
This commit is contained in:
Dan Balasescu 2017-07-19 17:46:49 +09:30 committed by GitHub
commit 285790bae0
2 changed files with 8 additions and 2 deletions

View File

@ -15,7 +15,7 @@ namespace osu.Game.Beatmaps.IO
AddReader<OszArchiveReader>((storage, path) =>
{
using (var stream = storage.GetStream(path))
return ZipFile.IsZipFile(stream, false);
return stream != null && ZipFile.IsZipFile(stream, false);
});
OsuLegacyDecoder.Register();
}

View File

@ -144,7 +144,11 @@ namespace osu.Game.Database
public void Import(params string[] paths)
{
foreach (string p in paths)
Import(p);
{
//In case the file was imported twice and deleted after the first time
if (File.Exists(p))
Import(p);
}
}
/// <summary>
@ -178,6 +182,8 @@ namespace osu.Game.Database
if (existing != null)
{
GetChildren(existing);
if (existing.DeletePending)
{
existing.DeletePending = false;