lib/contrast/agent/assess/policy/propagator/substitution.rb in contrast-agent-4.2.0 vs lib/contrast/agent/assess/policy/propagator/substitution.rb in contrast-agent-4.3.0
- old
+ new
@@ -90,12 +90,11 @@
false
end
end
def string_sub parent_events, self_tracked, preshift, ret, incoming, incoming_tracked, global
- properties = Contrast::Agent::Assess::Tracker.properties(ret)
- return unless properties
+ return unless (properties = Contrast::Agent::Assess::Tracker.properties!(ret))
incoming_properties = Contrast::Agent::Assess::Tracker.properties(incoming)
parent_event = incoming_properties&.event
parent_events << parent_event if parent_event
@@ -139,25 +138,26 @@
end
end
end
def block_sub self_tracked, source, ret
- properties = Contrast::Agent::Assess::Tracker.properties(ret)
- properties&.splat_from(source, ret) if self_tracked
+ return unless self_tracked
+
+ properties = Contrast::Agent::Assess::Tracker.properties!(ret)
+ properties&.splat_from(source, ret)
end
def hash_sub self_tracked, source, ret
- properties = Contrast::Agent::Assess::Tracker.properties(ret)
- properties&.splat_from(source, ret) if self_tracked
+ return unless self_tracked
+
+ properties = Contrast::Agent::Assess::Tracker.properties!(ret)
+ properties&.splat_from(source, ret)
end
def pattern_gsub parent_events, preshift, ret
- properties = Contrast::Agent::Assess::Tracker.properties(ret)
- return unless properties
-
source = preshift.object
- source_properties = Contrast::Agent::Assess::Tracker.properties(source)
- return unless source_properties
+ return unless (source_properties = Contrast::Agent::Assess::Tracker.properties(source))
+ return unless (properties = Contrast::Agent::Assess::Tracker.properties!(ret))
source_properties.tag_keys.each do |key|
properties.add_tag(key, 0...1)
end
parent_event = source_properties.event