aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-02-20 23:47:02 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-02-20 23:47:02 +0100
commit4a4521f46253e87a06af9333381c050e983b3c2f (patch)
treeb9af877c024aaf867f5c82108ad7c46d0270de0e /src
parent73c98405695837dd93448ed38c0eeb0b56060dfc (diff)
Fix nlohmann::json exception
Diffstat (limited to 'src')
-rw-r--r--src/libstore/fetchers/registry.cc3
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));
}