From b73deebe003306093913a8c62f2128917e181654 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 14 Jan 2019 18:43:46 -0800 Subject: correct release refs return value when empty --- rust/src/entity_crud.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/src/entity_crud.rs b/rust/src/entity_crud.rs index 6f0f77aa..1147e117 100644 --- a/rust/src/entity_crud.rs +++ b/rust/src/entity_crud.rs @@ -1814,7 +1814,7 @@ impl EntityCrud for ReleaseEntity { let refs: Option> = match (hide.refs, rev_row.refs_blob_sha1) { (true, _) => None, - (false, None) => None, + (false, None) => Some(vec![]), (false, Some(sha1)) => Some({ let refs_blob: RefsBlobRow = refs_blob::table .find(sha1) // checked in match @@ -1961,6 +1961,10 @@ impl EntityCrud for ReleaseEntity { refs_blob_sha1.push(None); }, Some(ref_list) => { + if ref_list.is_empty() { + refs_blob_sha1.push(None); + continue + } // Have to strip out target refs and indexes, or hashing won't work well when // these change let ref_list: Vec = ref_list -- cgit v1.2.3