diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-08-29 17:39:55 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-08-29 17:49:17 +0300 |
commit | aa4d6a3e68f8319e8a050715a88bf52252732f38 (patch) | |
tree | 8f575de5a619e2d8751fe05882fca243f3bbb6f2 | |
parent | 9caa44624c688ebba6bc041c273102150b1a59e7 (diff) |
Fix rep-info crash when no repository fragments are fetched
-rw-r--r-- | bpkg/rep-info.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bpkg/rep-info.cxx b/bpkg/rep-info.cxx index 35b06ca..1187a11 100644 --- a/bpkg/rep-info.cxx +++ b/bpkg/rep-info.cxx @@ -174,14 +174,13 @@ namespace bpkg } } - // Append the latest base repository manifest. + // Append the latest base repository manifest or an empty base if + // there are no fragments. // - // Note that there must be at least one fragment. - // - assert (!rfd.fragments.empty ()); - rms.push_back ( - find_base_repository (rfd.fragments.back ().repositories)); + !rfd.fragments.empty () + ? find_base_repository (rfd.fragments.back ().repositories) + : repository_manifest ()); auto serialize = [&rms] (ostream& os, const string& name) { |