mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:23:22 +08:00
Catch directory not found exception
This commit is contained in:
parent
75e6bbc4d8
commit
42b2c32222
@ -438,7 +438,15 @@ namespace osu.Game.Database
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
return Task.Factory.StartNew(() => Import(stable.GetDirectories(ImportFromStablePath).Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning);
|
||||
return Task.Factory.StartNew(() => {
|
||||
try {
|
||||
Import(stable.GetDirectories(ImportFromStablePath).Select(f => stable.GetFullPath(f)).ToArray());
|
||||
} catch (DirectoryNotFoundException) {
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user