mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add safety against calling GetStableImportPaths
when path doesn't exist
This commit is contained in:
@ -24,8 +24,14 @@ namespace osu.Game.Database
|
||||
/// <summary>
|
||||
/// Select paths to import from stable where all paths should be absolute. Default implementation iterates all directories in <see cref="ImportFromStablePath"/>.
|
||||
/// </summary>
|
||||
protected virtual IEnumerable<string> GetStableImportPaths(Storage storage) => storage.GetDirectories(ImportFromStablePath)
|
||||
.Select(path => storage.GetFullPath(path));
|
||||
protected virtual IEnumerable<string> GetStableImportPaths(Storage storage)
|
||||
{
|
||||
if (!storage.ExistsDirectory(ImportFromStablePath))
|
||||
return Enumerable.Empty<string>();
|
||||
|
||||
return storage.GetDirectories(ImportFromStablePath)
|
||||
.Select(path => storage.GetFullPath(path));
|
||||
}
|
||||
|
||||
protected readonly IModelImporter<TModel> Importer;
|
||||
|
||||
|
Reference in New Issue
Block a user