From 957cf69baea09cc96f6c9deadf506bf9a4bab6f4 Mon Sep 17 00:00:00 2001 From: beirich Date: Sun, 20 Feb 2011 06:49:16 +0000 Subject: [PATCH] make controls processing more resilient against malformed binding strings --- BizHawk.MultiClient/Input/Input.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BizHawk.MultiClient/Input/Input.cs b/BizHawk.MultiClient/Input/Input.cs index 78f1de95f2..dedc3f4d53 100644 --- a/BizHawk.MultiClient/Input/Input.cs +++ b/BizHawk.MultiClient/Input/Input.cs @@ -30,6 +30,9 @@ namespace BizHawk.MultiClient private static bool IsPressedSingle(string control) { + if (string.IsNullOrEmpty(control)) + return false; + if (control.StartsWith("J1 ")) return GetGamePad(0, control.Substring(3)); if (control.StartsWith("J2 ")) return GetGamePad(1, control.Substring(3)); if (control.StartsWith("J3 ")) return GetGamePad(2, control.Substring(3));