7185678: java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java failed with NPE

Reviewed-by: art, ahgross
This commit is contained in:
Oleg Pekhovskiy 2012-07-25 19:46:00 +04:00
parent f28b488994
commit 79a36f32ee

View File

@ -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() {