diff --git a/lib/awful.lua.in b/lib/awful.lua.in index e81af2a4..626b6364 100644 --- a/lib/awful.lua.in +++ b/lib/awful.lua.in @@ -940,11 +940,13 @@ end -- @param text Text to escape. -- @return Escape text. function escape(text) - text = text:gsub("&", "&") - text = text:gsub("<", "<") - text = text:gsub(">", ">") - text = text:gsub("'", "'") - text = text:gsub("\"", """) + if text then + text = text:gsub("&", "&") + text = text:gsub("<", "<") + text = text:gsub(">", ">") + text = text:gsub("'", "'") + text = text:gsub("\"", """) + end return text end @@ -952,11 +954,13 @@ end -- @param text Text to unescape. -- @return Unescaped text. function unescape(text) - text = text:gsub("&", "&") - text = text:gsub("<", "<") - text = text:gsub(">", ">") - text = text:gsub("'", "'") - text = text:gsub(""", "\"") + if text then + text = text:gsub("&", "&") + text = text:gsub("<", "<") + text = text:gsub(">", ">") + text = text:gsub("'", "'") + text = text:gsub(""", "\"") + end return text end