Allow RulesetConfigCache to return null configs (#5835)

Allow RulesetConfigCache to return null configs
This commit is contained in:
Dean Herbert 2019-08-26 18:59:26 +09:00 committed by GitHub
commit 28dc51279a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ public RulesetConfigCache(SettingsStore settingsStore)
public IRulesetConfigManager GetConfigFor(Ruleset ruleset)
{
if (ruleset.RulesetInfo.ID == null)
throw new InvalidOperationException("The provided ruleset doesn't have a valid id.");
return null;
return configCache.GetOrAdd(ruleset.RulesetInfo.ID.Value, _ => ruleset.CreateConfig(settingsStore));
}