diff --git a/Engine/Source/Runtime/AudioMixer/Private/AudioMixerBlueprintLibrary.cpp b/Engine/Source/Runtime/AudioMixer/Private/AudioMixerBlueprintLibrary.cpp index 494a09a28518..2b2dfe7c7c64 100644 --- a/Engine/Source/Runtime/AudioMixer/Private/AudioMixerBlueprintLibrary.cpp +++ b/Engine/Source/Runtime/AudioMixer/Private/AudioMixerBlueprintLibrary.cpp @@ -536,12 +536,11 @@ void UAudioMixerBlueprintLibrary::RemoveSourceEffectFromPresetChain(const UObjec Chain = PresetChain->Chain; } - if (EntryIndex < Chain.Num()) + if (EntryIndex >= 0 && EntryIndex < Chain.Num()) { Chain.RemoveAt(EntryIndex); + MixerDevice->UpdateSourceEffectChain(PresetChainId, Chain, PresetChain->bPlayEffectChainTails); } - - MixerDevice->UpdateSourceEffectChain(PresetChainId, Chain, PresetChain->bPlayEffectChainTails); } } @@ -565,12 +564,11 @@ void UAudioMixerBlueprintLibrary::SetBypassSourceEffectChainEntry(const UObject* Chain = PresetChain->Chain; } - if (EntryIndex < Chain.Num()) + if (EntryIndex >= 0 && EntryIndex < Chain.Num()) { Chain[EntryIndex].bBypass = bBypassed; + MixerDevice->UpdateSourceEffectChain(PresetChainId, Chain, PresetChain->bPlayEffectChainTails); } - - MixerDevice->UpdateSourceEffectChain(PresetChainId, Chain, PresetChain->bPlayEffectChainTails); } }