Skip to content

Commit 64eb735

Browse files
author
Chenhe
committed
修复头像为空时崩溃
fix #21
1 parent dd33ada commit 64eb735

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/cc/chenhe/qqnotifyevo/core/NotificationProcessor.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,10 @@ abstract class NotificationProcessor(context: Context) {
678678
.setPersons(conversation.messages.map { it.person }.toSet().toTypedArray())
679679
.setShortLabel(conversation.name)
680680
.setLongLabel(conversation.name)
681-
.setIcon(IconCompat.createWithBitmap(avatarManager.getAvatar(conversation.name.hashCode())))
681+
.setIcon(
682+
avatarManager.getAvatar(conversation.name.hashCode())
683+
?.let { IconCompat.createWithBitmap(it) }
684+
)
682685
.setIntent(
683686
context.packageManager.getLaunchIntentForPackage(tag.pkg)
684687
?: Intent(context, PreferenceAty::class.java).apply {

0 commit comments

Comments
 (0)