changeset 26:f866daadcdf6

Avoid errors in case of unusual race condition closing windows with open dropdowns.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Fri, 07 Oct 2011 03:47:45 +0000
parents cb9635999171
children 68d7b903ee17
files gui.lua
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gui.lua	Wed Oct 05 02:14:07 2011 +0000
+++ b/gui.lua	Fri Oct 07 03:47:45 2011 +0000
@@ -377,9 +377,11 @@
 local eoi_editcell
 
 local function dropdownmenu_handler (ddbutton, subfunc, arg)
-	local i = _d:GetUserData("DD loot index")
-	subfunc(i,arg)
-	_d:GetUserData("eoiST"):OuroLoot_Refresh(i)
+	local i = _d and _d.GetUserData and _d:GetUserData("DD loot index")
+	if i then
+		subfunc(i,arg)
+		_d:GetUserData("eoiST"):OuroLoot_Refresh(i)
+	end
 end
 
 local function gen_easymenu_table (initial, list, funcs)