From 6588ef4cdbd5097de9fea534798b52f13b1faeb6 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 6 Jun 2021 00:18:01 +0200 Subject: [PATCH] fix crash when deleting non-existant trade --- trade_simple.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trade_simple.lua b/trade_simple.lua index 2856cd2..0130780 100644 --- a/trade_simple.lua +++ b/trade_simple.lua @@ -387,6 +387,9 @@ yl_speak_up.input_add_trade_simple = function(player, formname, fields) table.insert(yl_speak_up.npc_was_changed[ n_id ], "Dialog "..d_id..": Trade "..tostring(trade_id).." deleted from option ".. tostring(o_id)..".") + if(not(dialog.trades)) then + dialog.trades = {} + end -- delete the trade type result if(trade_id) then dialog.trades[ trade_id ] = nil