Skip to content

Commit

Permalink
fixed crash with "file goto"
Browse files Browse the repository at this point in the history
  • Loading branch information
martin2250 committed Sep 1, 2018
1 parent d7318ab commit 6f2186a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenCNCPilot/MainWindow.xaml.MachineStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private void Machine_FilePositionChanged()

if (ListViewFile.SelectedItem is TextBlock)
{
if (ListViewFile.SelectedIndex >= 0 && machine.PauseLines[ListViewFile.SelectedIndex])
if (ListViewFile.SelectedIndex >= 0 && ListViewFile.SelectedIndex < machine.File.Count && machine.PauseLines[ListViewFile.SelectedIndex])
((TextBlock)ListViewFile.SelectedItem).Background = Brushes.YellowGreen;
else
((TextBlock)ListViewFile.SelectedItem).Background = Brushes.Transparent;
Expand Down

0 comments on commit 6f2186a

Please sign in to comment.