AP_Scripting: prevent double close in web server

This commit is contained in:
Andrew Tridgell 2024-02-09 08:00:36 +11:00
parent 7b36adf49d
commit 5d789f46ea

View File

@ -913,7 +913,10 @@ local function Client(_sock, _idx)
function self.remove()
DEBUG(string.format("%u: removing client OFFSET=%u", idx, offset))
sock:close()
if sock then
sock:close()
sock = nil
end
self.closed = true
end