Disregarding errors when parsing numbers for LessThan and GreaterThan comparisons in the KeyCheck block.

This commit is contained in:
ruri
2019-04-16 19:41:09 +02:00
parent 4b7fdfb665
commit a7ab9922e4
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -5,6 +5,7 @@ using RuriLib.LS;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Media;
namespace RuriLib
{
+5 -1
View File
@@ -26,7 +26,11 @@ namespace RuriLib.Models
/// <returns>Whether the comparison is valid</returns>
public bool CheckKey(BotData data)
{
return ConditionChecker.Verify(LeftTerm, Condition, RightTerm, data);
try
{
return ConditionChecker.Verify(LeftTerm, Condition, RightTerm, data);
}
catch { return false; } // Return false if e.g. we can't parse the number for a LessThan/GreaterThan comparison.
}
}
}