When debugging with metatables that override __tostring the table might end up in a state when __tostring crashes (for example nil properties not being expected to be nil after full constructor is executed). I've fixed my local version of the lldebugger.lua with a pcall like this:
local function getPrintableValue(value)
local valueType = type(value)
if valueType == "string" then
return ("\"" .. tostring(value)) .. "\""
elseif ((valueType == "number") or (valueType == "boolean")) or (valueType == "nil") then
return tostring(value)
else
local _, x = pcall(tostring, value) -- FIX HERE
return ("[" .. x) .. "]"
end
end
Proper fix would be to do the fix in send.ts but since I don't have time to setup full ts build yet, I'm posting here for anyone who might have a similar issue.
When debugging with metatables that override
__tostring
the table might end up in a state when__tostring
crashes (for example nil properties not being expected to be nil after full constructor is executed). I've fixed my local version of thelldebugger.lua
with apcall
like this:Proper fix would be to do the fix in
send.ts
but since I don't have time to setup full ts build yet, I'm posting here for anyone who might have a similar issue.