Skip to content

Commit

Permalink
fix: commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed May 14, 2022
1 parent d2a4256 commit 8529041
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ suspend fun Release.toMessage(contact: Contact, type: MessageType, notice: Strin
}

suspend fun Commit.toMessage(contact: Contact, type: MessageType, notice: String): Message {
val image = author.avatar().uploadAsImage(contact)
val image = author?.avatar()?.uploadAsImage(contact)
return when (type) {
MessageType.TEXT -> buildMessageChain {
appendLine(image)
appendLine("$notice with commit by ${author.login} ")
if (image != null) appendLine(image)
appendLine("$notice with commit by ${author?.login ?: detail.author.email} ")
appendLine("URL: $htmlUrl ")
appendLine("CREATED_AT: $createdAt ")
appendLine(detail.message)
Expand All @@ -360,7 +360,7 @@ suspend fun Commit.toMessage(contact: Contact, type: MessageType, notice: String

item {
layout = 2
picture(coverUrl = image.queryUrl())
if (image != null) picture(coverUrl = image.queryUrl())
title(text = sha)
summary(text = detail.message)
}
Expand Down

0 comments on commit 8529041

Please sign in to comment.