mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 12:32:58 +08:00
Add very basic error handling when a directory cannot be enumerated
This commit is contained in:
parent
c048d9b6ae
commit
149cb93e8c
@ -16,6 +16,7 @@ using osu.Framework.Platform;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterfaceV2
|
||||
{
|
||||
@ -74,6 +75,8 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
||||
{
|
||||
directoryFlow.Clear();
|
||||
|
||||
try
|
||||
{
|
||||
if (directory.NewValue == null)
|
||||
{
|
||||
var drives = DriveInfo.GetDrives();
|
||||
@ -92,6 +95,13 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
currentDirectory.Value = directory.OldValue;
|
||||
|
||||
this.FlashColour(Color4.Red, 300);
|
||||
}
|
||||
}
|
||||
|
||||
private class CurrentDirectoryDisplay : CompositeDrawable
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user