You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/08/24 20:06:34 UTC

svn commit: r807325 - /incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuBarItemSkin.java

Author: gbrown
Date: Mon Aug 24 18:06:34 2009
New Revision: 807325

URL: http://svn.apache.org/viewvc?rev=807325&view=rev
Log:
Resolve issue PIVOT-241.

Modified:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuBarItemSkin.java

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuBarItemSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuBarItemSkin.java?rev=807325&r1=807324&r2=807325&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuBarItemSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuBarItemSkin.java Mon Aug 24 18:06:34 2009
@@ -194,6 +194,11 @@
         MenuBar.Item menuBarItem = (MenuBar.Item)button;
 
         if (menuBarItem.isSelected()) {
+            Menu menu = menuBarItem.getMenu();
+            if (menu == null) {
+                throw new IllegalStateException("Menu is not defined for " + button + ".");
+            }
+
             Display display = menuBarItem.getDisplay();
             Point menuBarItemLocation = menuBarItem.mapPointToAncestor(display, 0, getHeight());