]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add fail-safety
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 25 Jan 2024 11:54:36 +0000 (11:54 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 25 Jan 2024 11:54:56 +0000 (11:54 +0000)
lualib/lua_redis.lua

index edaae94434de8e79519a8c8621906296cb91ff75..818d955e95e14802e629b340fece598729223dc0 100644 (file)
@@ -1290,7 +1290,7 @@ local function add_redis_script(script, redis_params, caller_level, maybe_filena
   if not caller_level then
     caller_level = 2
   end
-  local caller = debug.getinfo(caller_level)
+  local caller = debug.getinfo(caller_level) or debug.getinfo(caller_level - 1) or E
 
   local new_script = {
     caller = caller,