Skip to content

Commit

Permalink
Fix trash restore crash
Browse files Browse the repository at this point in the history
No message selected, makes an attempt to index nil value
  • Loading branch information
Athozus committed Jun 18, 2023
1 parent bfd3692 commit 968f402
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
mail.show_mail_menu(name, sortfieldindex, sortdirection, filter)

elseif fields.restore then
mail.restore_mail(name, messagesTrash[mail.selected_idxs.trash[name]].id)
if messagesTrash[mail.selected_idxs.trash[name]] then
mail.restore_mail(name, messagesTrash[mail.selected_idxs.trash[name]].id)
end
mail.show_mail_menu(name, sortfieldindex, sortdirection, filter)

elseif fields.reply then
Expand Down

0 comments on commit 968f402

Please sign in to comment.