Skip to content

Commit

Permalink
Fix: Fix type handling in nauthilus_util.lua
Browse files Browse the repository at this point in the history
Ensure values are converted to strings before processing. This avoids type errors when dealing with non-string input that contains spaces.

Signed-off-by: Christian Roessner <[email protected]>
  • Loading branch information
Christian Roessner committed Nov 11, 2024
1 parent 41a6a2c commit 2f54f28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/lua-plugins.d/share/nauthilus_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ function nauthilus_util.print_result(logging, result, err_string)
local output_str = {}

for k, v in pairs(result) do
if string.match(v, "%s") then
v = '"' .. v .. '"'
if string.match(tostring(v), "%s") then
v = '"' .. tostring(v) .. '"'
end

table.insert(output_str, k .. '=' .. v)
table.insert(output_str, k .. '=' .. tostring(v))
end

print(table.concat(output_str, " "))
Expand Down

0 comments on commit 2f54f28

Please sign in to comment.