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

Fix when errors is not actually present

Oliver Günther3bfbdfbce98a
diff --git a/app/services/service_result.rb b/app/services/service_result.rb
index a2154e8f17d..2f1e707e689 100644
--- a/app/services/service_result.rb
+++ b/app/services/service_result.rb
@@ -185,7 +185,7 @@ class ServiceResult
def new_errors_with_result
ActiveModel::Errors.new(self).tap do |errors|
- errors.merge!(result) if result.respond_to?(:errors)
+ errors.merge!(result) if result.try(:errors).present?
end
end