lib/pupa/processor/helper.rb in pupa-0.0.10 vs lib/pupa/processor/helper.rb in pupa-0.0.11
- old
+ new
@@ -6,10 +6,12 @@
# strips leading and ending spaces.
#
# @param [String] a string
# @return [String] a clean string
def clean(string)
- string.gsub(/[[:space:]]/, ' ').squeeze(' ').strip
+ if string
+ string.gsub(/[[:space:]]/, ' ').squeeze(' ').strip
+ end
end
end
end
end