Skip including a build if it doesn't exist.

This catches branch specifications where no build is available.
This commit is contained in:
Mathias Meyer 2014-06-18 11:16:02 +02:00
parent 99395d85c1
commit 5081bb157f

View File

@ -7,6 +7,7 @@ module Travis::Api::App::Responders
TEMPLATE_ERB = ERB.new <<-EOF
<Projects>
<% @resource.each do |r| %>
<% next if r.last_completed_build(branch).nil? -%>
<Project
name="<%= r.slug %>"
activity="<%= ACTIVITY[r.last_completed_build(branch).state.to_sym] || ACTIVITY[:default] %>"