diff --git a/app/scripts/resources/scripts/resources/functions/database.lua b/app/scripts/resources/scripts/resources/functions/database.lua index 2e82a9123e..5e612334bb 100644 --- a/app/scripts/resources/scripts/resources/functions/database.lua +++ b/app/scripts/resources/scripts/resources/functions/database.lua @@ -41,6 +41,7 @@ local function apply_params(db, sql, params) local str = string.gsub(sql, param_pattern, function(param) local v, t = params[param], type(params[param]) + if "NULL" == v then return 'NULL' end if "string" == t then return db:quote(v) end if "number" == t then return tostring(v) end if "boolean" == t then return v and '1' or '0' end