Handle nil value in client _sync

This commit is contained in:
2026-04-20 10:35:36 -04:00
parent 151355a790
commit 9e95b1fd78

View File

@@ -445,6 +445,7 @@ function Client:_sync(options)
for _, kind in ipairs { "join", "invite", "leave" } do
local handle = self["_sync_handle_room__" .. kind]
if response.rooms != nil then
for room_id, room_data in pairs(response.rooms[kind]) do
self._log("sync: %s %s", kind, room_id)
-- XXX: Maybe this is abusing pcall() too much to allow handler
@@ -456,6 +457,9 @@ function Client:_sync(options)
self._log("sync: Event payload: %s", json.encode(room_data))
end
end
else
self._log("sync: Error syncing rooms (nil value)"
end
end
end