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

Don't raise an exception in the search controller

Oliver Günther4161b33b47bb
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index 0abaef848fa..13ce6f9a45a 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -105,9 +105,8 @@ class SearchController < ApplicationController
end
def offset
- Time.at(Rational(search_params[:offset])) if search_params[:offset]
- rescue TypeError
- nil
+ value = Rational(search_params[:offset], exception: false)
+ Time.zone.at(value) if value
end
def projects_to_search