]> source.dussan.org Git - redmine.git/commitdiff
Prevent error when referencing an issue without project (#7890).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 16 Mar 2011 20:52:48 +0000 (20:52 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 16 Mar 2011 20:52:48 +0000 (20:52 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5157 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/changeset.rb

index c4f1f3fc1df665c77072942ec9103a2ee920e5e5..7195408235f2068c6b988229791331f08a06da25 100644 (file)
@@ -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