Skip to content

Commit

Permalink
fix Potential NPE in Cache.HandlerFor - this closes #898 - attempt 2 (
Browse files Browse the repository at this point in the history
  • Loading branch information
dorsev authored and alexarchambault committed Oct 8, 2018
1 parent dbaf748 commit 320ef97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/cache/jvm/src/main/scala/coursier/Cache.scala
Expand Up @@ -206,7 +206,7 @@ object Cache {
case None =>
val clsName = s"coursier.cache.protocol.${protocol.capitalize}Handler"
def clsOpt(loader: ClassLoader): Option[Class[_]] =
try Option(loader).map(_.loadClass(clsName))
try Some(Class.forName(clsName, false, loader))
catch {
case _: ClassNotFoundException =>
None
Expand Down

0 comments on commit 320ef97

Please sign in to comment.