mirror of https://github.com/sbt/sbt.git
Fixing more NullPointerError by wrapping license URL with Option
This commit is contained in:
parent
71e7e12b99
commit
3fe8f41a69
|
|
@ -107,9 +107,12 @@ object IvyRetrieve {
|
|||
})
|
||||
val isDefault = Option(dep.getDescriptor) map { _.isDefault }
|
||||
val configurations = dep.getConfigurations(confReport.getConfiguration).toArray.toList
|
||||
val licenses: Seq[(String, URL)] = mdOpt match {
|
||||
case Some(md) => md.getLicenses.toArray.toVector collect { case lic: IvyLicense => (lic.getName, new URL(lic.getUrl)) }
|
||||
case _ => Nil
|
||||
val licenses: Seq[(String, Option[String])] = mdOpt match {
|
||||
case Some(md) => md.getLicenses.toArray.toVector collect {
|
||||
case lic: IvyLicense =>
|
||||
(lic.getName, Option(lic.getUrl))
|
||||
}
|
||||
case _ => Nil
|
||||
}
|
||||
val callers = dep.getCallers(confReport.getConfiguration).toArray.toVector map { toCaller }
|
||||
val (resolved, missing) = artifacts(moduleId, confReport getDownloadReports revId)
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ final class ModuleReport(
|
|||
val isDefault: Option[Boolean],
|
||||
val branch: Option[String],
|
||||
val configurations: Seq[String],
|
||||
val licenses: Seq[(String, URL)],
|
||||
val licenses: Seq[(String, Option[String])],
|
||||
val callers: Seq[Caller]) {
|
||||
|
||||
private[this] lazy val arts: Seq[String] = artifacts.map(_.toString) ++ missingArtifacts.map(art => "(MISSING) " + art)
|
||||
|
|
@ -162,7 +162,7 @@ final class ModuleReport(
|
|||
isDefault: Option[Boolean] = isDefault,
|
||||
branch: Option[String] = branch,
|
||||
configurations: Seq[String] = configurations,
|
||||
licenses: Seq[(String, URL)] = licenses,
|
||||
licenses: Seq[(String, Option[String])] = licenses,
|
||||
callers: Seq[Caller] = callers): ModuleReport =
|
||||
new ModuleReport(module, artifacts, missingArtifacts, status, publicationDate, resolver, artifactResolver,
|
||||
evicted, evictedData, evictedReason, problem, homepage, extraAttributes, isDefault, branch, configurations, licenses, callers)
|
||||
|
|
|
|||
Loading…
Reference in New Issue