do not try to display multi ssh command from history when there are none, fixes #1595

This commit is contained in:
Faryan Rezagholi
2019-09-27 09:50:01 +02:00
parent baf2037ca1
commit 8b060745ef
2 changed files with 10 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed
- #1460: Updated GeckoFX to v60
### Fixed
- #1595: Unhandled exception when trying to browse through non existent multi ssh history with keyboard key strokes
- #1337: Unhandled exception after closing mRemoteNG
## [1.77.1] - 2019-09-02

View File

@@ -99,14 +99,16 @@ namespace mRemoteNG.Tools
if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)
{
e.SuppressKeyPress = true;
if (e.KeyCode == Keys.Up && previousCommandIndex - 1 >= 0)
switch (e.KeyCode)
{
previousCommandIndex -= 1;
}
if (e.KeyCode == Keys.Down && previousCommandIndex + 1 < previousCommands.Count)
{
previousCommandIndex += 1;
case Keys.Up when previousCommandIndex - 1 >= 0:
previousCommandIndex -= 1;
break;
case Keys.Down when previousCommandIndex + 1 < previousCommands.Count:
previousCommandIndex += 1;
break;
default:
return;
}
txtMultiSSH.Text = previousCommands[previousCommandIndex].ToString();