diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-14 18:43:46 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-14 18:43:52 -0800 |
commit | b73deebe003306093913a8c62f2128917e181654 (patch) | |
tree | 59c6b08e4645146f876d9a919977ed98c34fdd69 /rust/src/entity_crud.rs | |
parent | 7638bcfe7a31d3aef06f9112578a5ee8d55ee076 (diff) | |
download | fatcat-b73deebe003306093913a8c62f2128917e181654.tar.gz fatcat-b73deebe003306093913a8c62f2128917e181654.zip |
correct release refs return value when empty
Diffstat (limited to 'rust/src/entity_crud.rs')
-rw-r--r-- | rust/src/entity_crud.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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<Vec<ReleaseRef>> = 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<ReleaseRef> = ref_list |