automod: add safeguard to config preprocessor
This commit is contained in:
parent
f500034729
commit
18a1b4c31f
1 changed files with 5 additions and 0 deletions
|
@ -53,6 +53,11 @@ const configPreprocessor: ConfigPreprocessorFn<AutomodPluginType> = options => {
|
||||||
if (options.config?.rules) {
|
if (options.config?.rules) {
|
||||||
// Loop through each rule
|
// Loop through each rule
|
||||||
for (const [name, rule] of Object.entries(options.config.rules)) {
|
for (const [name, rule] of Object.entries(options.config.rules)) {
|
||||||
|
if (rule == null) {
|
||||||
|
delete options.config.rules[name];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
rule["name"] = name;
|
rule["name"] = name;
|
||||||
|
|
||||||
// If the rule doesn't have an explicitly set "enabled" property, set it to true
|
// If the rule doesn't have an explicitly set "enabled" property, set it to true
|
||||||
|
|
Loading…
Add table
Reference in a new issue