diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-02-20 23:47:02 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-02-20 23:47:02 +0100 |
commit | 4a4521f46253e87a06af9333381c050e983b3c2f (patch) | |
tree | b9af877c024aaf867f5c82108ad7c46d0270de0e /src | |
parent | 73c98405695837dd93448ed38c0eeb0b56060dfc (diff) |
Fix nlohmann::json exception
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/fetchers/registry.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/fetchers/registry.cc b/src/libstore/fetchers/registry.cc index fad389d17..721af0c9b 100644 --- a/src/libstore/fetchers/registry.cc +++ b/src/libstore/fetchers/registry.cc @@ -64,7 +64,8 @@ void Registry::write(const Path & path) nlohmann::json obj; obj["from"] = attrsToJson(std::get<0>(elem)->toAttrs()); obj["to"] = attrsToJson(std::get<1>(elem)->toAttrs()); - obj["to"].update(attrsToJson(std::get<2>(elem))); + if (!std::get<2>(elem).empty()) + obj["to"].update(attrsToJson(std::get<2>(elem))); arr.emplace_back(std::move(obj)); } |