Skip to content

Commit

Permalink
[AN] fix: 채팅 알림 이미지가 빈 문자열 에러처리 (#717)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaeun5744 authored Oct 23, 2024
1 parent 14bbd65 commit 4cbc0db
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ class AlarmReceiver : FirebaseMessagingService() {
) = Person.Builder()
.setName(senderName)
.setIcon(
senderProfile?.let {
IconCompat.createWithBitmap(createRoundedBitmap(it))
} ?: IconCompat.createWithResource(this, R.drawable.ic_normal_profile),
if (senderProfile.isNullOrBlank()) {
IconCompat.createWithResource(this, R.drawable.ic_normal_profile)
} else {
IconCompat.createWithBitmap(createRoundedBitmap(senderProfile))
},
)
.build()

Expand Down Expand Up @@ -230,13 +232,15 @@ class AlarmReceiver : FirebaseMessagingService() {
ShortcutInfoCompat.Builder(this@AlarmReceiver, chatRoomId.toString())
.setIntent(contentIntent).setShortLabel(chatRoomName)
.setIcon(
chatRoomImage?.let {
if (chatRoomImage.isNullOrBlank()) {
IconCompat.createWithResource(this, R.mipmap.ic_launcher)
} else {
IconCompat.createWithBitmap(
createRoundedBitmap(
it,
chatRoomImage,
),
)
} ?: IconCompat.createWithResource(this, R.mipmap.ic_launcher),
},
)
.setLongLabel(chatRoomName)
.setAlwaysBadged()
Expand Down

0 comments on commit 4cbc0db

Please sign in to comment.