From dd2610207b0c420188a1cdab4faa993039a74c9f Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 7 Apr 2020 13:24:56 -0500 Subject: [PATCH] Check to make sure artifact has a url Before we fetch it, it needs to exist, otherwise we core-dump. Change-Id: I086a706c70807bc547b286b0f587a27f9f19d38e --- zuul-preview/main.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zuul-preview/main.cc b/zuul-preview/main.cc index 848fb55..e5aeff7 100644 --- a/zuul-preview/main.cc +++ b/zuul-preview/main.cc @@ -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(); } }