From 1dde4097f98f8d7fb579b93889891fa9f97c0407 Mon Sep 17 00:00:00 2001 From: Athozus Date: Sun, 24 Mar 2024 17:38:54 +0100 Subject: [PATCH] Fix empty mailing lists --- storage.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage.lua b/storage.lua index 8d992da..901b985 100644 --- a/storage.lua +++ b/storage.lua @@ -346,6 +346,9 @@ function mail.get_maillist_by_name(playername, listname) local entry = mail.get_storage_entry(playername) for _, list in ipairs(entry.lists) do if list.name == listname then + if not list.players then + list.players = {} + end return list end end @@ -362,6 +365,9 @@ function mail.update_maillist(playername, list, old_list_name) end end -- insert + if not list.players then + list.players = {} + end table.insert(entry.lists, list) mail.set_storage_entry(playername, entry) end