fix: null author in commits (#16)

This commit is contained in:
Diamond 2022-09-18 12:32:37 -07:00 • committed by GitHub
parent 9efa79f6cb
commit 749587cf12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View file

@ -14,7 +14,7 @@ data class Commit(
val htmlUrl: String,
val sha: String,
val commit: Commit,
val author: Author
val author: Author?
) {
@Serializable
data class Author(@SerialName("login") val name: String)

View file

@ -201,7 +201,7 @@ fun HomeScreen(
ListItem(
modifier = Modifier.clickable { uriHandler.openUri(commitData.htmlUrl) },
overlineText = { Text(commitData.sha.substring(0, 7)) },
headlineText = { Text("${commitData.commit.message.split("\n").first()} - ${commitData.author.name}") }
headlineText = { Text("${commitData.commit.message.split("\n").first()} - ${commitData.author?.name ?: "UNKNOWN"}") }
)
}

View file

@ -1,4 +1,3 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
@ -6,11 +5,8 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:7.4.0-alpha10")
classpath("com.android.tools.build:gradle:7.3.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts files
}
}