From a4df7bf986bb116cc3cea7268c655a7d59d93d5c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 15 May 2022 23:32:20 +0100 Subject: [PATCH] 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 --- src/bundles.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.30.2