Commits

Anonymous committed 489e76b

When an error is encountered while converting a Lisp menu specification
to its internal form, don't fail an assert(). Instead, return 0 to skip
the fault menu and show any errors in *Warnings*.

Comments (0)

Files changed (2)

+2013-01-16  Jerry James  <james@xemacs.org>
+
+	* menubar-x.c (set_frame_menubar): when a menubar specification has an
+	error, don't fail an assert() and bring XEmacs down.  Instead, return
+	0 to skip the faulty menu and show any errors in *Warnings*.
+
 2013-01-04  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.33 "horseradish" is released.
     }
 }
 
+/* Returns the converted menubar, or NULL if an error is encountered while
+ * converting the Lisp menu specification.
+ */
 static widget_value *
 compute_menubar_data (struct frame *f, Lisp_Object menubar, int deep_p)
 {
     menubar_visible = !NILP (w->menubar_visible_p);
 
   data = compute_menubar_data (f, menubar, deep_p);
-  assert (data && (data->next || data->contents));
+  if (!data || (!data->next && !data->contents))
+    return 0;
 
   if (!FRAME_X_MENUBAR_ID (f))
     FRAME_X_MENUBAR_ID (f) = new_lwlib_id ();
 	{
 	  free_popup_widget_value_tree (data);
 	  data = compute_menubar_data (f, menubar, 1);
+	  if (!data || (!data->next && !data->contents))
+	    return 0;
 	}