src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java
changeset 48691 554cb38e0caf
parent 48327 d2a837cf9ff1
child 53043 fd2e8f941ded
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java	Wed Jan 31 11:25:34 2018 -0800
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java	Wed Jan 31 14:21:52 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -109,7 +109,9 @@
      */
     private Function<byte[],byte[]> createVersionedLinks(int version) {
         HashMap<IndexNode,byte[]> aliasMap = new HashMap<>();
-        getVersionMap(version, getInode(getBytes("/META-INF/versions"))).values()
+        IndexNode verdir = getInode(getBytes("/META-INF/versions"));
+        if (verdir != null) {
+            getVersionMap(version, verdir).values()
                 .forEach(versionNode -> {   // for each META-INF/versions/{n} directory
                     // put all the leaf inodes, i.e. entries, into the alias map
                     // possibly shadowing lower versioned entries
@@ -124,6 +126,7 @@
                         }
                     });
                 });
+        }
         return path -> aliasMap.get(IndexNode.keyOf(path));
     }