Merge pull request #3436 from plankp/patch-2

Handle lack of skins directory when importing from osu!stable
This commit is contained in:
Dean Herbert 2018-09-21 12:16:43 +09:00 committed by GitHub
commit 7a58343201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -96,7 +96,8 @@ private void flushEvents(bool perform)
private void handleEvent(Action a)
{
if (delayingEvents)
lock (queuedEvents) queuedEvents.Add(a);
lock (queuedEvents)
queuedEvents.Add(a);
else
a.Invoke();
}
@ -438,6 +439,13 @@ public Task ImportFromStableAsync()
return Task.CompletedTask;
}
if (!stable.ExistsDirectory(ImportFromStablePath))
{
// 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);
return Task.CompletedTask;
}
return Task.Factory.StartNew(() => Import(stable.GetDirectories(ImportFromStablePath).Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning);
}