Skip to content

Commit

Permalink
修复头像为空时崩溃
Browse files Browse the repository at this point in the history
fix #21
  • Loading branch information
Chenhe committed Sep 22, 2021
1 parent dd33ada commit 64eb735
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,10 @@ abstract class NotificationProcessor(context: Context) {
.setPersons(conversation.messages.map { it.person }.toSet().toTypedArray())
.setShortLabel(conversation.name)
.setLongLabel(conversation.name)
.setIcon(IconCompat.createWithBitmap(avatarManager.getAvatar(conversation.name.hashCode())))
.setIcon(
avatarManager.getAvatar(conversation.name.hashCode())
?.let { IconCompat.createWithBitmap(it) }
)
.setIntent(
context.packageManager.getLaunchIntentForPackage(tag.pkg)
?: Intent(context, PreferenceAty::class.java).apply {
Expand Down

0 comments on commit 64eb735

Please sign in to comment.