Skip to content

Commit 62eb9e9

Browse files
committed
Check jar name before calling getVirtualFileForJar()
#KT-17331 Fixed
1 parent 406714a commit 62eb9e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

idea/idea-analysis/src/org/jetbrains/kotlin/idea/framework/JsLibraryStdDetectionUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ object JsLibraryStdDetectionUtil {
5757
for (root in classesRoots) {
5858
if (root.fileSystem.protocol !== StandardFileSystems.JAR_PROTOCOL) continue
5959

60-
val jar = VfsUtilCore.getVirtualFileForJar(root) ?: continue
61-
val name = jar.name
60+
val name = root.url.substringBefore("!/").substringAfterLast('/')
6261
if (name == PathUtil.JS_LIB_JAR_NAME || name == PathUtil.JS_LIB_10_JAR_NAME ||
6362
PathUtil.KOTLIN_STDLIB_JS_JAR_PATTERN.matcher(name).matches() ||
6463
PathUtil.KOTLIN_JS_LIBRARY_JAR_PATTERN.matcher(name).matches()) {
6564

65+
val jar = VfsUtilCore.getVirtualFileForJar(root) ?: continue
6666
var isJSStdLib = jar.getUserData(IS_JS_LIBRARY_STD_LIB)
6767
if (isJSStdLib == null) {
6868
isJSStdLib = LibraryUtils.isKotlinJavascriptStdLibrary(File(jar.path))

0 commit comments

Comments
 (0)