File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -472,12 +472,11 @@ object KaTeX {
472472
473473// Provides access to resources of a bundled WebJar.
474474class WebJar (artifactId : String ) {
475+ private val classLoader = classOf [WebJar ].getClassLoader
476+
475477 private val version : String =
476478 val propsPath = s " META-INF/maven/org.webjars.npm/ $artifactId/pom.properties "
477- val stream = Thread
478- .currentThread()
479- .getContextClassLoader
480- .getResourceAsStream(propsPath)
479+ val stream = classLoader.getResourceAsStream(propsPath)
481480 if stream == null then
482481 throw IllegalStateException (
483482 s " Could not find pom.properties for webjar ' $artifactId' on the classpath. "
@@ -489,10 +488,7 @@ class WebJar(artifactId: String) {
489488 // Load a resource from this WebJar as a String, uses relative paths.
490489 def load (path : String ): String =
491490 val resourcePath = s " META-INF/resources/webjars/ $artifactId/ $version/ $path"
492- val stream = Thread
493- .currentThread()
494- .getContextClassLoader
495- .getResourceAsStream(resourcePath)
491+ val stream = classLoader.getResourceAsStream(resourcePath)
496492 if stream == null then
497493 throw IllegalStateException (
498494 s " Could not find resource ' $path' in webjar ' $artifactId' ( $version). "
You can’t perform that action at this time.
0 commit comments