Skip to content

Commit 7c12e9c

Browse files
committed
Fix crash on viewing trigger references when map contains an unknown trigger action type
1 parent 1f99cf5 commit 7c12e9c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/TSMapEditor/UI/Windows/TriggersWindow.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,13 @@ private void ShowReferences()
534534
}
535535

536536
// Check other triggers to see whether this trigger is referenced by them
537-
var allReferringTriggers = map.Triggers.FindAll(trig => {
537+
var allReferringTriggers = map.Triggers.FindAll(trig =>
538+
{
538539
foreach (var triggerAction in trig.Actions)
539540
{
541+
if (!map.EditorConfig.TriggerEventTypes.ContainsKey(triggerAction.ActionIndex))
542+
continue;
543+
540544
var actionType = map.EditorConfig.TriggerActionTypes[triggerAction.ActionIndex];
541545

542546
for (int i = 0; i < triggerAction.Parameters.Length && i < actionType.Parameters.Length; i++)

0 commit comments

Comments
 (0)