liquid_feedback_frontend

diff env/util/trim.lua @ 236:de8602f8d9bb

Make trim properly handle nil as an argument
author Ingo Bormuth <mail@ibormuth.de>
date Sun Nov 27 13:33:42 2011 +0100 (2011-11-27)
parents 0ee1e0c42d4c
children
line diff
     1.1 --- a/env/util/trim.lua	Sun Nov 27 13:31:05 2011 +0100
     1.2 +++ b/env/util/trim.lua	Sun Nov 27 13:33:42 2011 +0100
     1.3 @@ -1,3 +1,6 @@
     1.4  function util.trim(string)
     1.5 +  if string == nil then
     1.6 +    return string
     1.7 +  end
     1.8    return (string:gsub("^%s*", ""):gsub("%s*$", ""):gsub("%s+", " "))
     1.9 -end
    1.10 \ No newline at end of file
    1.11 +end

Impressum / About Us