From 2e95e18594226283956a298999ad5b00bab13a34 Mon Sep 17 00:00:00 2001 From: spag Date: Wed, 23 Jan 2013 11:34:04 +0100 Subject: exit on unsupported types --- misc/freeswitch/scripts/common/str.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/freeswitch/scripts/common/str.lua b/misc/freeswitch/scripts/common/str.lua index 32f054e..793c191 100644 --- a/misc/freeswitch/scripts/common/str.lua +++ b/misc/freeswitch/scripts/common/str.lua @@ -5,6 +5,10 @@ module(...,package.seeall) function try(array, arguments) + if type(arguments) ~= 'string' or type(array) ~= 'table' then + return nil; + end + local result = array; arguments:gsub('([^%.]+)', function(entry) -- cgit v1.2.3