mirror of
https://github.com/ppy/osu
synced 2025-02-01 10:51:53 +00:00
Handle directory checking before entering task
This commit is contained in:
parent
000beea01b
commit
8bfd981a50
@ -438,19 +438,14 @@ namespace osu.Game.Database
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Task.Factory.StartNew(() =>
|
if (!stable.ExistsDirectory(ImportFromStablePath))
|
||||||
{
|
{
|
||||||
try
|
// This handles situations like when the user does not have a Skins folder
|
||||||
{
|
Logger.Log("No " + ImportFromStablePath + " folder available in osu!stable installation", LoggingTarget.Information, LogLevel.Error);
|
||||||
Import(stable.GetDirectories(ImportFromStablePath).Select(f => stable.GetFullPath(f)).ToArray());
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
catch (DirectoryNotFoundException)
|
|
||||||
{
|
return Task.Factory.StartNew(() => Import(stable.GetDirectories(ImportFromStablePath).Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning);
|
||||||
// This handles situations like when the user does not have a Skins folder
|
|
||||||
// which would have this exception thrown from stable.GetDirectories
|
|
||||||
Logger.Log("No " + ImportFromStablePath + " folder available in osu!stable installation", LoggingTarget.Information, LogLevel.Error);
|
|
||||||
}
|
|
||||||
}, TaskCreationOptions.LongRunning);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user