diff --git a/zuul-preview/main.cc b/zuul-preview/main.cc index 186b268..848fb55 100644 --- a/zuul-preview/main.cc +++ b/zuul-preview/main.cc @@ -122,6 +122,7 @@ int main(int, char**) // output for each. // Expected input: // https://zuul.opendev.org site.167715b656ee4504baa940c5bd9f3821.openstack.preview.opendev.org + // https://zuul.opendev.org javascript_content.7cf36db4b8574ef6a5ba1a64cb827741.zuul.preview.opendev.org while (getline(cin, input)) { // Split the input into api_url, hostname @@ -166,7 +167,9 @@ int main(int, char**) string artifact_url = "Artifact_not_found"; for (uint i = 0; i < artifacts.size(); i++) { - if (artifacts[i]["name"].as_string() == artifact) { + if (artifacts[i].has_field("metadata") && + artifacts[i]["metadata"].has_field("type") && + artifacts[i]["metadata"]["type"].as_string() == artifact) { artifact_url = artifacts[i]["url"].as_string(); } }