From 15e120aff1ed69b2f0280c577312d83c2caa2417 Mon Sep 17 00:00:00 2001 From: Andrew Gilewsky Date: Thu, 2 Jan 2025 21:35:42 +0000 Subject: [PATCH] Out-of-bounds access to assignments should not crash. --- BossMod/Config/GroupAssignment.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BossMod/Config/GroupAssignment.cs b/BossMod/Config/GroupAssignment.cs index eab014d3fc..bc69a5b55f 100644 --- a/BossMod/Config/GroupAssignment.cs +++ b/BossMod/Config/GroupAssignment.cs @@ -22,7 +22,7 @@ public class GroupAssignment public int this[PartyRolesConfig.Assignment r] { - get => Assignments[(int)r]; + get => (int)r is var index && index >= 0 && index < Assignments.Length ? Assignments[index] : -1; set => Assignments[(int)r] = value; }