Quantcast

- Tickets #1300 and #1301 : Prevent an error causing Titan to not successfully initialize. This only prevents the error, it may help uncover the real issue.

urnati [03-22-21 - 21:35]
- Tickets #1300 and #1301 : Prevent an error causing Titan to not successfully initialize. This only prevents the error, it may help uncover the real issue.
Filename
Titan/TitanUtils.lua
diff --git a/Titan/TitanUtils.lua b/Titan/TitanUtils.lua
index 84af0d3..24b9633 100644
--- a/Titan/TitanUtils.lua
+++ b/Titan/TitanUtils.lua
@@ -1686,7 +1686,13 @@ OUT:
 - true (IsVisible) or false
 --]]
 function TitanPanelRightClickMenu_IsVisible()
-	return _G[drop_down_1]:IsVisible();
+	local res = false
+	if _G[drop_down_1] and _G[drop_down_1]:IsVisible() then
+		res = true
+	else
+		res = false
+	end
+	return res
 end

 --[[ Titan
@@ -1696,7 +1702,7 @@ VAR:  None
 OUT:  None
 --]]
 function TitanPanelRightClickMenu_Close()
-	if _G[drop_down_1]:IsVisible() then
+	if _G[drop_down_1] and _G[drop_down_1]:IsVisible() then
 		_G[drop_down_1]:Hide()
 	end
 end