Commit f34a566c authored by Jean-Philippe Lang's avatar Jean-Philippe Lang Committed by Eric Davis

Prevent error when referencing an issue without project (#7890).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5157 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent d71f4f2e
......@@ -174,7 +174,7 @@ class Changeset < ActiveRecord::Base
return nil if id.blank?
issue = Issue.find_by_id(id.to_i, :include => :project)
if issue
unless project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project)
unless issue.project && (project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project))
issue = nil
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment