Skip to content

Commit

Permalink
Fix empty mailing lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Athozus committed Mar 24, 2024
1 parent ccf07b5 commit 1dde409
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1dde409

Please sign in to comment.