Skip to content

Commit

Permalink
Fixed: Crash when changing load order of mod with keyboard/controller…
Browse files Browse the repository at this point in the history
… (Ctrl+Arrow) beyond list bounds
  • Loading branch information
Sewer56 committed Feb 13, 2025
1 parent ac6fd13 commit 7c92f44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/Reloaded.Mod.Launcher/Utility/ListViewUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal static bool ShiftItem(this ListView listView, int offset)
return false;

var insertIndex = GetInsertIndex(index, offset, list.Count);
if (insertIndex == -1)
if (insertIndex == -1 || insertIndex >= list.Count)
return false;

var item = list[index]!;
Expand Down

0 comments on commit 7c92f44

Please sign in to comment.