1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-01 02:22:55 +08:00

Avoid crashes on attempting to import the same path twice in quick succession

This commit is contained in:
Dean Herbert 2017-07-18 16:11:23 +09:00
parent 5761eb30a0
commit f00140f0a4

View File

@ -144,8 +144,12 @@ namespace osu.Game.Database
public void Import(params string[] paths) public void Import(params string[] paths)
{ {
foreach (string p in paths) foreach (string p in paths)
{
//In case the file was imported twice and deleted after the first time
if (File.Exists(p))
Import(p); Import(p);
} }
}
/// <summary> /// <summary>
/// Duplicates content from <paramref name="path"/> to storage and returns a representing <see cref="BeatmapSetInfo"/>. /// Duplicates content from <paramref name="path"/> to storage and returns a representing <see cref="BeatmapSetInfo"/>.