Permalink
Browse files

fixed exception on non digit char in settings number field

  • Loading branch information...
1 parent bc2bea1 commit 155430966bfa1a1ead317f00d0becc6be7ab8224 seuffert committed Mar 12, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 XBSlink/Form1.cs
View
@@ -987,7 +987,16 @@ private void checkBox_chatAutoSwitch_CheckedChanged(object sender, EventArgs e)
private bool handlePlusMinusInTextBox(char pressed_key, TextBox tb, int min, int max)
{
- int i = int.Parse(tb.Text);
+ int i;
+ try
+ {
+ i = int.Parse(tb.Text);
+ }
+ catch (Exception)
+ {
+ return false;
+ }
+
switch (pressed_key)
{
case '+':

0 comments on commit 1554309

Please sign in to comment.