Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Guard against scenario where the parent is having its first child created

Aaron Contrerasdc4cbbeac1c5
diff --git a/app/services/work_packages/update_ancestors_service.rb b/app/services/work_packages/update_ancestors_service.rb
index 5f9a166425e..02b8b0532f3 100644
--- a/app/services/work_packages/update_ancestors_service.rb
+++ b/app/services/work_packages/update_ancestors_service.rb
@@ -120,6 +120,8 @@ class WorkPackages::UpdateAncestorsService
end
def compute_derived_done_ratio(work_package, loader)
+ return if work_package.derived_estimated_hours.nil? || work_package.derived_remaining_hours.nil?
+
leaves = loader.leaves_of(work_package)
if leaves.size.positive?