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)
|
local entry = mail.get_storage_entry(playername)
|
||||||
for _, list in ipairs(entry.lists) do
|
for _, list in ipairs(entry.lists) do
|
||||||
if list.name == listname then
|
if list.name == listname then
|
||||||
|
if not list.players then
|
||||||
|
list.players = {}
|
||||||
|
end
|
||||||
return list
|
return list
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -362,6 +365,9 @@ function mail.update_maillist(playername, list, old_list_name)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- insert
|
-- insert
|
||||||
|
if not list.players then
|
||||||
|
list.players = {}
|
||||||
|
end
|
||||||
table.insert(entry.lists, list)
|
table.insert(entry.lists, list)
|
||||||
mail.set_storage_entry(playername, entry)
|
mail.set_storage_entry(playername, entry)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user