diff app/models/issue_relation.rb @ 117:af80e5618e9b redmine-1.1

* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author Chris Cannam
date Thu, 13 Jan 2011 12:53:21 +0000
parents 513646585e45
children 0c939c159af4
line wrap: on
line diff
--- a/app/models/issue_relation.rb	Fri Nov 19 14:05:24 2010 +0000
+++ b/app/models/issue_relation.rb	Thu Jan 13 12:53:21 2011 +0000
@@ -84,14 +84,15 @@
   
   def set_issue_to_dates
     soonest_start = self.successor_soonest_start
-    if soonest_start
+    if soonest_start && issue_to
       issue_to.reschedule_after(soonest_start)
     end
   end
   
   def successor_soonest_start
-    return nil unless (TYPE_PRECEDES == self.relation_type) && (issue_from.start_date || issue_from.due_date)
-    (issue_from.due_date || issue_from.start_date) + 1 + delay
+    if (TYPE_PRECEDES == self.relation_type) && delay && issue_from && (issue_from.start_date || issue_from.due_date)
+      (issue_from.due_date || issue_from.start_date) + 1 + delay
+    end
   end
   
   def <=>(relation)