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

[#61604] harden default function of property mapper

Eric Schubertdc7c86ef931f
diff --git a/app/models/types/patterns/token_property_mapper.rb b/app/models/types/patterns/token_property_mapper.rb
index fe9e3bb6086..77b2df6e214 100644
--- a/app/models/types/patterns/token_property_mapper.rb
+++ b/app/models/types/patterns/token_property_mapper.rb
@@ -31,7 +31,11 @@
module Types
module Patterns
class TokenPropertyMapper
- DEFAULT_FUNCTION = ->(key, context) { context.public_send(key.to_sym) }.curry
+ DEFAULT_FUNCTION = ->(key, context) do
+ return nil if context.nil?
+
+ context.public_send(key.to_sym)
+ end.curry
TOKEN_PROPERTY_MAP = IceNine.deep_freeze(
{