From: Ian Jackson Date: Sun, 15 May 2022 22:32:20 +0000 (+0100) Subject: bundles: Fix a bug which could cause IE on bundle load X-Git-Tag: otter-1.1.0~98 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a4df7bf986bb116cc3cea7268c655a7d59d93d5c;p=otter.git bundles: Fix a bug which could cause IE on bundle load We need to make an entry entry in the bundles notes array even if the hash is missing. Or we might try to reuse the bundle number, if there was a failed bundle upload followed by a server restart. Signed-off-by: Ian Jackson --- diff --git a/src/bundles.rs b/src/bundles.rs index 089286f3..41b08d64 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -1071,6 +1071,8 @@ impl InstanceBundles { }; let iu: usize = parsed.index().into(); + ib.bundles.get_or_extend_with(iu, default); + let hash = match ig.bundle_hashes.hashes.get(iu) { Some(Some(hash)) => hash, _ => { @@ -1079,8 +1081,6 @@ impl InstanceBundles { } }; - ib.bundles.get_or_extend_with(parsed.index().into(), default); - if_let!{ BundleSavefile::Bundle(id) = parsed; else continue; }