lib/solrizer/extractor.rb in solrizer-1.0.2 vs lib/solrizer/extractor.rb in solrizer-1.0.3

- old
+ new

@@ -26,12 +26,19 @@ end return solr_doc end # Strips the majority of whitespace from the values array and then joins them with a single blank delimitter - # @param [Array] values Array of strings representing the values returned + # Returns an empty string if values argument is nil + # + # @param [Array] values Array of strings representing the values to be formatted + # @return [String] def self.format_node_value values - values.map{|val| val.gsub(/\s+/,' ').strip}.join(" ") + if values.nil? + return "" + else + return values.map{|val| val.gsub(/\s+/,' ').strip}.join(" ") + end end # Instance Methods # Alias for Solrizer::Extractor#insert_solr_field_value