From: Ian Jackson Date: Sun, 1 May 2022 20:02:41 +0000 (+0100) Subject: apitest: updates: Recorded: Do not overwrite with nulls X-Git-Tag: otter-1.1.0~328 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=cc0c9bb1f091655808b943c05571c3a06bb10020;p=otter.git apitest: updates: Recorded: Do not overwrite with nulls Some of these fields are Option, and if None, should nto overwrite existing data. Signed-off-by: Ian Jackson --- diff --git a/apitest/atmain.rs b/apitest/atmain.rs index 103367a0..2f7bebca 100644 --- a/apitest/atmain.rs +++ b/apitest/atmain.rs @@ -435,7 +435,10 @@ pub fn update_update_pieces( if k == "Recorded" { let p = p.unwrap(); for k in ["zg", "svg", "desc"] { - p.info.set(k, &v[k]); + let v = &v[k]; + if ! v.is_null() { + p.info.set(k, v); + } } } else if k == "Piece" { let (op, d) = v["op"].as_object().unwrap().iter().next().unwrap();