lib/datacaster/switch_node.rb in datacaster-3.2.3 vs lib/datacaster/switch_node.rb in datacaster-3.2.4

- old
+ new

@@ -61,14 +61,11 @@ @ons.each do |check, clause| result = check.with_runtime(runtime).(switch_result) next unless result.valid? - if @pick_key.nil? - return clause.with_runtime(runtime).(object) - else - return runtime.checked_key!(@pick_key) { clause.with_runtime(runtime).(object) } - end + runtime.checked_key!(@pick_key) if !@pick_key.nil? && !@pick_key.is_a?(Array) + return clause.with_runtime(runtime).(object) end # all 'on'-s have failed return @else.with_runtime(runtime).(object) if @else