Fix for RPF Explorer crash when previously opened folder was deleted

This commit is contained in:
dexy 2021-04-14 15:23:20 +10:00
parent 66b1d619fe
commit 2b8ac5bb65

View File

@ -686,11 +686,26 @@ namespace CodeWalker
RefreshMainTreeViewRoot(root); RefreshMainTreeViewRoot(root);
var remFolders = new List<MainTreeFolder>();
foreach (var extraroot in ExtraRootFolders) foreach (var extraroot in ExtraRootFolders)
{ {
extraroot.Clear(); extraroot.Clear();
if (Directory.Exists(extraroot.FullPath))
{
RefreshMainTreeViewRoot(extraroot); RefreshMainTreeViewRoot(extraroot);
} }
else
{
remFolders.Add(extraroot);
}
}
foreach (var remFolder in remFolders)
{
ExtraRootFolders.Remove(remFolder);
}
Ready = true; Ready = true;