changeset 54975:c2b366b9c360

8207938: At step6,Click Add button,case failed automatically. Reviewed-by: kaddepalli, psadhukhan
author mhalder
date Wed, 06 Feb 2019 17:28:37 +0530
parents 9bb638b282bc
children 43c5b0532d49
files src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Tue Feb 05 14:54:06 2019 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Wed Feb 06 17:28:37 2019 +0530
@@ -208,11 +208,13 @@
 
         CImage cimage = CImage.getCreator().createFromImage(image, observer);
         boolean imageAutoSize = target.isImageAutoSize();
-        cimage.execute(imagePtr -> {
-            execute(ptr -> {
-                setNativeImage(ptr, imagePtr, imageAutoSize);
+        if (cimage != null) {
+            cimage.execute(imagePtr -> {
+                execute(ptr -> {
+                    setNativeImage(ptr, imagePtr, imageAutoSize);
+                });
             });
-        });
+        }
     }
 
     private native void setNativeImage(final long model, final long nsimage, final boolean autosize);
@@ -357,7 +359,7 @@
     class IconObserver implements ImageObserver {
         @Override
         public boolean imageUpdate(Image image, int flags, int x, int y, int width, int height) {
-            if (image != target.getImage()) // if the image has been changed
+            if (target == null || image != target.getImage()) //if the image has been changed
             {
                 return false;
             }