From cc0c9bb1f091655808b943c05571c3a06bb10020 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 May 2022 21:02:41 +0100 Subject: [PATCH] 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 --- apitest/atmain.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); -- 2.30.2