Fix exception when deleting multiple mods at once.

This commit is contained in:
Ottermandias 2026-01-09 02:28:46 +01:00
parent cf4b6c2ce8
commit e1bbc48779
2 changed files with 12 additions and 3 deletions

2
Luna

@ -1 +1 @@
Subproject commit 616d66b1d384588c23a3b5725ad1330037ce6987 Subproject commit 59967db0b6fba6e85d04d91e91ed07a35cb42d69

View file

@ -72,8 +72,17 @@ public sealed class ModFileSystem : BaseFileSystem, IDisposable, IRequiredServic
Selection.Select(data); Selection.Select(data);
break; break;
case ModPathChangeType.Deleted: case ModPathChangeType.Deleted:
if (arguments.Mod.Node is not null) if (arguments.Mod.Node is { } node)
Delete(arguments.Mod.Node); {
// Unselect all because of event spaghetti.
// If two nodes are selected and one is deleted, the remaining one
// will try to fetch settings down the line and possibly break.
// Untangling the events is hard.
if (node.Selected)
Selection.UnselectAll();
Delete(node);
}
break; break;
case ModPathChangeType.Reloaded: case ModPathChangeType.Reloaded:
// Nothing // Nothing