Skip to content

Commit

Permalink
Fixed "A TypeError occurred in graphs#target_version_graph" when ther…
Browse files Browse the repository at this point in the history
…e are no issues.
  • Loading branch information
edavis10 committed May 17, 2009
1 parent 8fdc521 commit 2836583
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/graphs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ def target_version_graph
issues_by_created_on = @version.fixed_issues.group_by {|issue| issue.created_on.to_date }.sort
issues_by_updated_on = @version.fixed_issues.group_by {|issue| issue.updated_on.to_date }.sort
issues_by_closed_on = @version.fixed_issues.collect { |issue| issue if issue.closed? }.compact.group_by {|issue| issue.updated_on.to_date }.sort


# About the request if no issues were found.
if issues_by_created_on.empty? && issues_by_updated_on.empty? && issues_by_closed_on.empty?
render(:nothing => true)
return false
end

# Set the scope of the graph
scope_end_date = issues_by_updated_on.keys.last
scope_end_date = @version.effective_date if !@version.effective_date.nil? && @version.effective_date > scope_end_date
Expand Down

0 comments on commit 2836583

Please sign in to comment.