7185678: java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java failed with NPE
authorbagiras
Wed, 25 Jul 2012 19:46:00 +0400
changeset 13606 91c629b8d59e
parent 13605 be3bee073685
child 13607 665f736c1913
child 13608 a2effa5fb0c3
7185678: java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java failed with NPE Reviewed-by: art, ahgross
jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java
--- a/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java	Mon Jul 23 15:51:46 2012 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java	Wed Jul 25 19:46:00 2012 +0400
@@ -202,7 +202,8 @@
         if (target == null) {
             return "";
         }
-        return AWTAccessor.getMenuItemAccessor().getLabel(target);
+        String label = AWTAccessor.getMenuItemAccessor().getLabel(target);
+        return (label == null) ? "" : label;
     }
 
     boolean isTargetEnabled() {