mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-24 01:38:53 +02:00
Added try-catch for return Matchers
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using JetBrains.Annotations;
|
||||
using WireMock.Validation;
|
||||
|
||||
@@ -32,7 +33,17 @@ namespace WireMock.Matchers
|
||||
/// </returns>
|
||||
public bool IsMatch(string input)
|
||||
{
|
||||
return input != null && _expression.IsMatch(input);
|
||||
if (input == null)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
return _expression.IsMatch(input);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user