Skip to content

Commit

Permalink
Merge pull request #138 from MattEqualsCoder/fix-swap-crash
Browse files Browse the repository at this point in the history
Fix crash with swapping tracks
  • Loading branch information
MattEqualsCoder authored Oct 7, 2024
2 parents 86089ec + 4e852ae commit 660b946
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion MSUScripter/MSUScripter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationIcon>MSUScripterIcon.ico</ApplicationIcon>
<PackageIcon>MSUScripterIcon.ico</PackageIcon>
<Version>4.1.0</Version>
<Version>4.1.1</Version>
<RuntimeFrameworkVersion>8.0.0</RuntimeFrameworkVersion>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<LangVersion>12</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 660b946

Please sign in to comment.