diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java index 8cd8a725af4..496524c10b3 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java @@ -202,7 +202,8 @@ public class XMenuItemPeer implements MenuItemPeer { if (target == null) { return ""; } - return AWTAccessor.getMenuItemAccessor().getLabel(target); + String label = AWTAccessor.getMenuItemAccessor().getLabel(target); + return (label == null) ? "" : label; } boolean isTargetEnabled() {