Skip to content

Commit

Permalink
tastudio: clamp newCell for dragged branches.
Browse files Browse the repository at this point in the history
this fixes another OOB crash.
  • Loading branch information
feos committed Jul 30, 2015
1 parent 90cdbc1 commit a8fc799
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ private void BranchView_CellDropped(object sender, InputRoll.CellEventArgs e)
int originalIndex = Branches.IndexOf(branch);
int newIndex = e.NewCell.RowIndex.Value;

if (newIndex >= Branches.Count)
newIndex = Branches.Count - 1;

Branches.Remove(branch);
Branches.Insert(newIndex, branch);
}
Expand Down

0 comments on commit a8fc799

Please sign in to comment.