diff --git a/src/Games/NexusMods.Games.FOMOD/CoreDelegates/UiDelegate.cs b/src/Games/NexusMods.Games.FOMOD/CoreDelegates/UiDelegate.cs index 590b98b2ec..89c0ee35b3 100644 --- a/src/Games/NexusMods.Games.FOMOD/CoreDelegates/UiDelegate.cs +++ b/src/Games/NexusMods.Games.FOMOD/CoreDelegates/UiDelegate.cs @@ -85,6 +85,9 @@ public void ReportError( public void UpdateState(FomodInstaller.Interface.ui.InstallerStep[] installSteps, int currentStepId) { + // NOTE (erri120): The FOMOD library we're using can send us stupid inputs. + if (currentStepId < 0 || currentStepId >= installSteps.Length) return; + // NOTE (erri120): The FOMOD library we're using was designed for threading in JavaScript. // A semaphore is required because the library can spawn multiple tasks on different threads // that will call this method multiple times. This can lead to double-state and it's @@ -92,8 +95,6 @@ public void UpdateState(FomodInstaller.Interface.ui.InstallerStep[] installSteps using var waiter = _semaphoreSlim.CustomWait(TimeSpan.Zero); if (!waiter.HasEntered) return; - Debug.Assert(currentStepId >= 0 && currentStepId < installSteps.Length); - var groupIdMappings = new List>(); var optionIdMappings = new List>();