Fix NPE in FakeResolver

This commit is contained in:
Martin Duhem 2016-04-15 16:25:52 +02:00
parent 175ece4238
commit 81e350325e
1 changed files with 2 additions and 1 deletions

View File

@ -57,6 +57,7 @@ private[sbt] class FakeResolver(private var name: String, cacheDir: File, module
throw new UnsupportedOperationException("This resolver doesn't support publishing.")
override def download(artifact: ArtifactOrigin, options: DownloadOptions): ArtifactDownloadReport = {
val report = new ArtifactDownloadReport(artifact.getArtifact)
val path = new URL(artifact.getLocation).toURI.getPath
val localFile = new File(path)
@ -77,7 +78,7 @@ private[sbt] class FakeResolver(private var name: String, cacheDir: File, module
artifacts foreach { art =>
val artifactOrigin = locate(art)
report.addArtifactReport(download(artifactOrigin, options))
Option(locate(art)) foreach (o => report.addArtifactReport(download(o, options)))
}
report