diff --git a/MSUScripter/MSUScripter.csproj b/MSUScripter/MSUScripter.csproj index 5357760..56936ac 100644 --- a/MSUScripter/MSUScripter.csproj +++ b/MSUScripter/MSUScripter.csproj @@ -8,7 +8,7 @@ true MSUScripterIcon.ico MSUScripterIcon.ico - 4.1.0 + 4.1.1 8.0.0 false 12 diff --git a/MSUScripter/Services/ControlServices/CopyMoveTrackWindowService.cs b/MSUScripter/Services/ControlServices/CopyMoveTrackWindowService.cs index 1b6a6bd..1424f03 100644 --- a/MSUScripter/Services/ControlServices/CopyMoveTrackWindowService.cs +++ b/MSUScripter/Services/ControlServices/CopyMoveTrackWindowService.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -65,8 +66,8 @@ public void RunCopyMove() var swapSong = destinationTrack.Songs[_model.TargetLocation]; previousTrack.Songs.Remove(songInfo); destinationTrack.Songs.Remove(swapSong); - previousTrack.Songs.Insert(originalIndex, swapSong); - destinationTrack.Songs.Insert(_model.TargetLocation, songInfo); + previousTrack.Songs.Insert(Math.Clamp(originalIndex, 0, previousTrack.Songs.Count), swapSong); + destinationTrack.Songs.Insert(Math.Clamp(_model.TargetLocation, 0, destinationTrack.Songs.Count), songInfo); } previousTrack.FixTrackSuffixes(songInfo.CanPlaySongs);