changeset 10734:f5594a98ead9

8193161: NullPointerException when generating image/installer on Linux Reviewed-by: almatvee
author vdrozdov
date Thu, 07 Dec 2017 18:20:59 -0800
parents 31c7f9661f09
children f9706c9613a5
files modules/jdk.packager/src/main/java/jdk/packager/internal/legacy/builders/linux/LinuxAppImageBuilder.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/jdk.packager/src/main/java/jdk/packager/internal/legacy/builders/linux/LinuxAppImageBuilder.java	Thu Dec 07 18:00:39 2017 -0800
+++ b/modules/jdk.packager/src/main/java/jdk/packager/internal/legacy/builders/linux/LinuxAppImageBuilder.java	Thu Dec 07 18:20:59 2017 -0800
@@ -210,8 +210,10 @@
 
     private void copyIcon() throws IOException {
         File icon = ICON_PNG.fetchFrom(params);
-        File iconTarget = new File(resourcesDir.toFile(), APP_FS_NAME.fetchFrom(params) + ".png");
-        IOUtils.copyFile(icon, iconTarget);
+        if (icon != null) {
+            File iconTarget = new File(resourcesDir.toFile(), APP_FS_NAME.fetchFrom(params) + ".png");
+            IOUtils.copyFile(icon, iconTarget);
+        }
     }
 
     private void copyApplication() throws IOException {