Quantcast

Avoid non-existing dropdowns

Adrian L Lange [04-28-12 - 18:13]
Avoid non-existing dropdowns
Filename
oUF_P3lim.lua
diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua
index 9b44e0a..540b7bc 100644
--- a/oUF_P3lim.lua
+++ b/oUF_P3lim.lua
@@ -12,7 +12,10 @@ local BACKDROP = {
 }

 local function SpawnMenu(self)
-	ToggleDropDownMenu(1, nil, _G[string.gsub(self.unit, '^.', string.upper)..'FrameDropDown'], 'cursor')
+	local dropdown = _G[string.gsub(self.unit, '^.', string.upper)..'FrameDropDown']
+	if(dropdown) then
+		ToggleDropDownMenu(1, nil, dropdown, 'cursor')
+	end
 end

 local function PostUpdatePower(element, unit, min, max)