src/Pure/Admin/ci_api.scala
changeset 64545 25045094d7bb
parent 64160 1eea419fab65
     1.1 --- a/src/Pure/Admin/ci_api.scala	Wed Oct 12 09:38:20 2016 +0200
     1.2 +++ b/src/Pure/Admin/ci_api.scala	Sat Dec 10 17:20:39 2016 +0100
     1.3 @@ -32,7 +32,7 @@
     1.4  
     1.5    def build_jobs(): List[String] =
     1.6      for {
     1.7 -      job <- JSON.array(invoke(root()), "jobs")
     1.8 +      job <- JSON.array(invoke(root()), "jobs").getOrElse(Nil)
     1.9        _class <- JSON.string(job, "_class")
    1.10        if _class == "hudson.model.FreeStyleProject"
    1.11        name <- JSON.string(job, "name")
    1.12 @@ -56,7 +56,8 @@
    1.13  
    1.14      for {
    1.15        build <- JSON.array(
    1.16 -        invoke(root() + "/job/" + job_name, "tree=builds[number,timestamp,artifacts[*]]"), "builds")
    1.17 +          invoke(root() + "/job/" + job_name, "tree=builds[number,timestamp,artifacts[*]]"), "builds")
    1.18 +        .getOrElse(Nil)
    1.19        number <- JSON.int(build, "number")
    1.20        timestamp <- JSON.long(build, "timestamp")
    1.21      } yield {
    1.22 @@ -64,7 +65,7 @@
    1.23        val output = Url(job_prefix + "/consoleText")
    1.24        val session_logs =
    1.25          for {
    1.26 -          artifact <- JSON.array(build, "artifacts")
    1.27 +          artifact <- JSON.array(build, "artifacts").getOrElse(Nil)
    1.28            log_path <- JSON.string(artifact, "relativePath")
    1.29            session <- (log_path match { case Log_Session(name) => Some(name) case _ => None })
    1.30          } yield (session -> Url(job_prefix + "/artifact/" + log_path))