Check to make sure artifact has a url

Before we fetch it, it needs to exist, otherwise we core-dump.

Change-Id: I086a706c70807bc547b286b0f587a27f9f19d38e
This commit is contained in:
Monty Taylor 2020-04-07 13:24:56 -05:00
parent e0d10c611e
commit dd2610207b

View File

@ -169,7 +169,8 @@ int main(int, char**)
for (uint i = 0; i < artifacts.size(); i++) {
if (artifacts[i].has_field("metadata") &&
artifacts[i]["metadata"].has_field("type") &&
artifacts[i]["metadata"]["type"].as_string() == artifact) {
artifacts[i]["metadata"]["type"].as_string() == artifact &&
artifacts[i].has_field("url")) {
artifact_url = artifacts[i]["url"].as_string();
}
}