Fix empty mailing lists
This commit is contained in:
parent
ccf07b50e2
commit
1dde4097f9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user