Browse Source

prevent silent error on context menu exception

Nicolas Cannasse 5 years ago
parent
commit
8a61b550bd
1 changed files with 7 additions and 1 deletions
  1. 7 1
      hide/comp/ContextMenu.hx

+ 7 - 1
hide/comp/ContextMenu.hx

@@ -38,7 +38,13 @@ class ContextMenu {
 		var m = new nw.MenuItem(mconf);
 		if( i.checked != null ) m.checked = i.checked;
 		if( i.enabled != null ) m.enabled = i.enabled;
-		m.click = i.click;
+		m.click = function() {
+			try {
+				i.click();
+			} catch( e : Dynamic ) {
+				hide.Ide.inst.error(e);
+			}
+		}
 		return m;
 	}