Salome HOME
MenuAction mapping is fixed for the case if no item is selected. The default selectio...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / MenuAction.java
index 3764e28160183124764026538f42b4c5ec3b2697..c9c0dc9eb6185b83b558fcf8ae8370392269adc3 100644 (file)
@@ -34,9 +34,12 @@ public class MenuAction extends Action {
 
                if (_item == null) { // Switch back to the menu, keeping the last selection
                        getSession().put("menu.open", menu); // Activates the menu
-                       _item = menu.getSelection();
-                       if (_item == null) {
-                               _item = "none";
+                       if (menu != null) {
+                               _item = menu.getSelection();
+                               if (_item == null) { // Select default menu item if nothing has been selected
+                                       _item = menu.getDefaultSelection();
+                                       menu.selects(_item);
+                               }
                        }
                } else { // Selection of another menu item
                        menu.selects(_item);