changeset 5430:89e947dc2928

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 e1df1f677a41
children c15961951936
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	Wed Jul 18 23:12:23 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() {