changeset 5854:cc089c819470

RT-34579: Mac: OS X System MenuBar causes null pointer exception with a graphic that has a null Image. Summary: Added a null check
author Anthony Petrov <anthony.petrov@oracle.com>
date Fri, 29 Nov 2013 00:40:19 +0400
parents 20724ec5e62e
children ff6e3fb3b1e8
files modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassSystemMenu.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassSystemMenu.java	Fri Nov 29 08:25:49 2013 +1300
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassSystemMenu.java	Fri Nov 29 00:40:19 2013 +0400
@@ -317,8 +317,10 @@
 
     private Pixels getPixels(MenuItemBase menuItem) {
         if (menuItem.getGraphic() instanceof ImageView) {
-            ImageView iv           = (ImageView)menuItem.getGraphic();
-            Image     im           = iv.getImage();
+            ImageView iv = (ImageView)menuItem.getGraphic();
+            Image     im = iv.getImage();
+            if (im == null) return null;
+            
             String    url          = im.impl_getUrl();
 
             if (url == null || PixelUtils.supportedFormatType(url)) {