From f145d8e65532d7120db4836e709c7f77834d1fd0 Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 26 Mar 2012 23:38:29 +0000 Subject: [PATCH] Cheat Window, Ram Watc, Lua Console - fix exception when clicking Move Up on the first item in the list. --- BizHawk.MultiClient/tools/Cheats.cs | 2 ++ BizHawk.MultiClient/tools/LuaConsole.cs | 3 +++ BizHawk.MultiClient/tools/RamWatch.cs | 2 ++ 3 files changed, 7 insertions(+) diff --git a/BizHawk.MultiClient/tools/Cheats.cs b/BizHawk.MultiClient/tools/Cheats.cs index be4b8cb8fa..9b53651c47 100644 --- a/BizHawk.MultiClient/tools/Cheats.cs +++ b/BizHawk.MultiClient/tools/Cheats.cs @@ -270,6 +270,8 @@ namespace BizHawk.MultiClient private void MoveUp() { ListView.SelectedIndexCollection indexes = CheatListView.SelectedIndices; + if (indexes[0] == 0) + return; Cheat temp = new Cheat(); if (indexes.Count == 0) return; foreach (int index in indexes) diff --git a/BizHawk.MultiClient/tools/LuaConsole.cs b/BizHawk.MultiClient/tools/LuaConsole.cs index f82199c893..0652c9a5b0 100644 --- a/BizHawk.MultiClient/tools/LuaConsole.cs +++ b/BizHawk.MultiClient/tools/LuaConsole.cs @@ -471,6 +471,9 @@ namespace BizHawk.MultiClient private void MoveUp() { ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices; + if (indexes[0] == 0) + return; + LuaFile temp = new LuaFile(false); if (indexes.Count == 0) return; foreach (int index in indexes) diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index e70f8477c4..5579143b61 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -517,6 +517,8 @@ namespace BizHawk.MultiClient if (WatchListView.SelectedIndices.Count == 0) return; ListView.SelectedIndexCollection indexes = WatchListView.SelectedIndices; + if (indexes[0] == 0) + return; Watch temp = new Watch(); if (indexes.Count == 0) return; foreach (int index in indexes)