changeset 5329:82f02d1af0b9

7185678: java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java failed with NPE Reviewed-by: art, ahgross
author bagiras
date Wed, 25 Jul 2012 19:59:07 +0400
parents 7f068b486ec8
children 83163c4895e3
files src/solaris/classes/sun/awt/X11/XMenuItemPeer.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java	Tue Jun 26 22:28:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java	Wed Jul 25 19:59:07 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() {