From 5c05c10f83b98451f8e5bb725078a1e5e52f9ac9 Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 10 Dec 2025 10:49:46 +0300 Subject: [PATCH] zapret-lib: return 0 if #val refers to non-string and non-table type --- lua/zapret-lib.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/zapret-lib.lua b/lua/zapret-lib.lua index 072ee12..9f3d929 100644 --- a/lua/zapret-lib.lua +++ b/lua/zapret-lib.lua @@ -130,7 +130,8 @@ function apply_arg_prefix(desync) for a,v in pairs(desync.arg) do local c = string.sub(v,1,1) if c=='#' then - desync.arg[a] = #blob(desync,string.sub(v,2)) + local blb = blob(desync,string.sub(v,2)) + desync.arg[a] = (type(blb)=='string' or type(blb)=='table') and #blb or 0 elseif c=='%' then desync.arg[a] = blob(desync,string.sub(v,2)) elseif c=='\\' then