Add a try-catch when scanning for mods.

This commit is contained in:
Ottermandias 2024-04-23 15:50:09 +02:00
parent e21c9fb6d1
commit 792a04337f

View file

@ -1,3 +1,4 @@
using System.Security.AccessControl;
using Penumbra.Communication;
using Penumbra.Mods.Editor;
using Penumbra.Services;
@ -310,6 +311,8 @@ public sealed class ModManager : ModStorage, IDisposable
/// then add the mods from the queue.
/// </summary>
private void ScanMods()
{
try
{
var options = new ParallelOptions()
{
@ -329,4 +332,11 @@ public sealed class ModManager : ModStorage, IDisposable
Mods.Add(mod);
}
}
catch (Exception ex)
{
Valid = false;
_communicator.ModDirectoryChanged.Invoke(BasePath.FullName, false);
Penumbra.Log.Error($"Could not scan for mods:\n{ex}");
}
}
}