Skip to content

Commit

Permalink
Fix potential null keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rphillips-nz committed Jul 21, 2021
1 parent b2f79ce commit 9e01bea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cloudcannon-jekyll/jsonify-filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def self.document_data_to_a(data, prevent, depth, max_depth)
prevent += %w(content output next previous excerpt)

out = data.map do |key, value|
next if prevent.include? key
next if prevent.include?(key) || key.nil?

prevent.push key
next_max_depth = key == "_array_structures" ? 20 : max_depth
Expand Down Expand Up @@ -167,7 +167,7 @@ def self.config_to_select_data_json(input, depth)

out = input.map do |key, value|
next unless value.is_a?(Array) || value.is_a?(Hash)
next if prevent.include? key
next if prevent.include?(key) || key.nil?

prevent.push key
"#{key.to_s.to_json}: #{JsonifyFilter.to_json(value, depth)}"
Expand Down

0 comments on commit 9e01bea

Please sign in to comment.