Fix improper parsing; add null check

This commit is contained in:
Noikoio 2018-09-21 20:39:36 -07:00
parent d8cb46113a
commit 7ce2788594

View file

@ -46,13 +46,14 @@ namespace Kerobot.Common
valueSrc = config[whitelistKey]; valueSrc = config[whitelistKey];
Mode = FilterMode.Whitelist; Mode = FilterMode.Whitelist;
} }
else if (valueSrc != null && blacklistKey != null) if (valueSrc != null && blacklistKey != null)
{ {
// Try getting a blacklist // Try getting a blacklist
valueSrc = config[blacklistKey]; valueSrc = config[blacklistKey];
Mode = FilterMode.Blacklist; Mode = FilterMode.Blacklist;
} }
else
if (valueSrc == null)
{ {
// Got neither. Have an empty list. // Got neither. Have an empty list.
Mode = FilterMode.None; Mode = FilterMode.None;