From d877dd06526888c7e4099a30e18aed452547ec05 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 31 Jan 2018 14:45:24 -0700 Subject: [PATCH] Update languages.lua Prevent a nill error when the phrase was not found. --- .../resources/scripts/languages/languages.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/languages/languages.lua b/resources/install/scripts/app/xml_handler/resources/scripts/languages/languages.lua index 69bae958cc..420c4e85ce 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/languages/languages.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/languages/languages.lua @@ -164,12 +164,14 @@ end --set the cache - local ok, err = cache.set(language_cache_key, XML_STRING, expire["acl"]); - if debug["cache"] then - if ok then - freeswitch.consoleLog("notice", "[xml_handler] " .. language_cache_key .. " stored in the cache\n"); - else - freeswitch.consoleLog("warning", "[xml_handler] " .. language_cache_key .. " can not be stored in the cache: " .. tostring(err) .. "\n"); + if (XML_STRING) then + local ok, err = cache.set(language_cache_key, XML_STRING, expire["acl"]); + if debug["cache"] then + if ok then + freeswitch.consoleLog("notice", "[xml_handler] " .. language_cache_key .. " stored in the cache\n"); + else + freeswitch.consoleLog("warning", "[xml_handler] " .. language_cache_key .. " can not be stored in the cache: " .. tostring(err) .. "\n"); + end end end