Fix exception when rate limit not defined

This commit is contained in:
Noikoio 2017-08-30 00:28:34 -07:00
parent 2e9036b26a
commit d560ca5c94

View file

@ -79,7 +79,7 @@ namespace Noikoio.RegexBot.Feature.AutoRespond
_filter = new FilterList(data);
// rate limiting
string rlstr = data["ratelimit"].Value<string>();
string rlstr = data["ratelimit"]?.Value<string>();
if (string.IsNullOrWhiteSpace(rlstr))
{
_limit = new RateLimitCache(RateLimitCache.DefaultTimeout);