Fix occasional NPE from reflection initialization
This could happen when a .jar containing Kotlin stdlib and reflection classes was launched with 'java -jar'
This commit is contained in:
@@ -91,7 +91,8 @@ public abstract class KotlinBuiltIns {
|
||||
new Function1<String, InputStream>() {
|
||||
@Override
|
||||
public InputStream invoke(String path) {
|
||||
return KotlinBuiltIns.class.getClassLoader().getResourceAsStream(path);
|
||||
ClassLoader classLoader = KotlinBuiltIns.class.getClassLoader();
|
||||
return classLoader != null ? classLoader.getResourceAsStream(path) : ClassLoader.getSystemResourceAsStream(path);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user