Skip to content

Commit

Permalink
add the condition of nil? or empty? before adding the no_lang
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Mar 18, 2022
1 parent 7c9aa72 commit ba27011
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/goo/sparql/mixins/solution_lang_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def save_other_lang_val(id, attr, index, value)
def matched_languages(index_values, model_attribute_val)
not_matched_lang = index_values[:not_matched]
matched_lang = index_values.reject { |key| key == :not_matched }
matched_lang[:no_lang] = Array(model_attribute_val) unless model_attribute_val.nil?
unless model_attribute_val.nil? || model_attribute_val.empty?
matched_lang[:no_lang] = Array(model_attribute_val)
end
[matched_lang, not_matched_lang]
end
end
Expand Down

0 comments on commit ba27011

Please sign in to comment.