Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix(harper.js): overriding `null` config value

Elijah Potter75d6fe40f4f5
diff --git a/harper-core/src/linting/lint_group.rs b/harper-core/src/linting/lint_group.rs
index 8458c9857..d741f577d 100644
--- a/harper-core/src/linting/lint_group.rs
+++ b/harper-core/src/linting/lint_group.rs
@@ -105,7 +105,13 @@ impl LintGroupConfig {
///
/// Conflicting keys will be overridden by the value in the other group.
pub fn merge_from(&mut self, other: &mut LintGroupConfig) {
- self.inner.extend(other.inner.drain());
+ for (key, val) in other.inner.drain() {
+ if val.is_none() {
+ continue;
+ }
+
+ self.inner.insert(key, val);
+ }
}
/// Fill the group with the values for the curated lint group.