diff Libs/DF/dropdown.lua @ 55:307f5af3ad02

- Framework update.
author Tercio
date Sat, 09 Dec 2017 11:49:01 -0200
parents a960d5372b0c
children 0682d738499b
line wrap: on
line diff
--- a/Libs/DF/dropdown.lua	Sat Oct 14 17:09:27 2017 -0300
+++ b/Libs/DF/dropdown.lua	Sat Dec 09 11:49:01 2017 -0200
@@ -483,7 +483,13 @@
 		
 	--> exec function if any
 		if (button.table.onclick) then
-			button.table.onclick (button:GetParent():GetParent():GetParent().MyObject, button.object.FixedValue, button.table.value)	
+		
+			local success, errorText = pcall (button.table.onclick, button:GetParent():GetParent():GetParent().MyObject, button.object.FixedValue, button.table.value)
+			if (not success) then
+				error ("Details! Framework: dropdown " .. button:GetParent():GetParent():GetParent().MyObject:GetName() ..  " error: " .. errorText)
+			end
+			
+			--button.table.onclick (button:GetParent():GetParent():GetParent().MyObject, button.object.FixedValue, button.table.value)	
 		end
 		
 	--> set the value of selected option in main object