use empty buffer if the other map is empty in dconf

This commit is contained in:
Damien Elmes 2020-05-18 08:12:27 +10:00
parent 7ec3f1ecc0
commit 010f0f33b5

View file

@ -212,7 +212,11 @@ impl From<DeckConfSchema11> for DeckConf {
c.other.insert("lapse".into(), val);
}
}
let other_bytes = serde_json::to_vec(&c.other).unwrap_or_default();
let other_bytes = if c.other.is_empty() {
vec![]
} else {
serde_json::to_vec(&c.other).unwrap_or_default()
};
DeckConf {
id: c.id,