Changeset - a321f999a1ea
[Not reviewed]
default
0 1 0
Jason Maltzen - 12 months ago 2021-07-23 07:56:44
jason@hiddenachievement.com
Fix a crash when trying to reorder the reaction list after recording the first reaction in the list.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
ViewModels/ExperimentLogViewModel.cs
Show inline comments
...
 
@@ -135,7 +135,10 @@ namespace DesertPaintCodex.ViewModels
 
        {
 
            int oldPos = list.IndexOf(test);
 

	
 
            if (((oldPos > 0) || (test.CompareTo(list[oldPos - 1]) > 0))
 
            // If the item is first in the list or the previous item is valued < the test
 
            // And either the item is last in the list or the next item in the list is valued > than the item
 
            // Don't move it
 
            if (((oldPos == 0) || (test.CompareTo(list[oldPos - 1]) > 0))
 
                && ((oldPos == list.Count - 1) || (test.CompareTo(list[oldPos + 1]) < 0))) return oldPos; // No need to move.
 

	
 
            list.RemoveAt(oldPos);
0 comments (0 inline, 0 general)