mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Github API fix.
This commit is contained in:
parent
fd2c9a932f
commit
1a58b70a8e
1 changed files with 10 additions and 7 deletions
|
@ -117,14 +117,17 @@ class GithubApi2 @Inject constructor(
|
|||
} else {
|
||||
service.getReleasesNoAuth("cbeust", "kobalt")
|
||||
}
|
||||
val releases = req.execute()
|
||||
.body()
|
||||
releases.firstOrNull()?.let {
|
||||
try {
|
||||
result = listOf(it.name, it.tagName).filterNotNull().first { !it.isBlank() }
|
||||
} catch(ex: NoSuchElementException) {
|
||||
throw KobaltException("Couldn't find the latest release")
|
||||
val releases = req.execute().body()
|
||||
if (releases != null) {
|
||||
releases.firstOrNull()?.let {
|
||||
try {
|
||||
result = listOf(it.name, it.tagName).filterNotNull().first { !it.isBlank() }
|
||||
} catch(ex: NoSuchElementException) {
|
||||
throw KobaltException("Couldn't find the latest release")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
warn("Didn't receive any body in the response to GitHub.getReleases()")
|
||||
}
|
||||
} catch(e: Exception) {
|
||||
log(1, "Couldn't retrieve releases from github: " + e.message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue