From e8dcfc6d4baf12ef946f36ad26e8537f146c2f04 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 1 Nov 2017 10:13:39 -0700 Subject: [PATCH] More syntax fix. --- .../src/main/kotlin/com/beust/kobalt/misc/GithubApi2.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi2.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi2.kt index d377b674..b33286e0 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi2.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi2.kt @@ -138,8 +138,8 @@ class GithubApi2 @Inject constructor( val releases = ex.body() if (releases != null) { releases.firstOrNull()?.let { - try { - result = listOf(it.name, it.tagName).filterNotNull().first { !it.isBlank() } + result = try { + listOf(it.name, it.tagName).filterNotNull().first { !it.isBlank() } } catch(ex: NoSuchElementException) { throw KobaltException("Couldn't find the latest release") }