Fix possible crash when colorizing group names

Fixes #13751
This commit is contained in:
Greyson Parrelli
2024-10-28 09:46:14 -04:00
parent 22e774a976
commit 2cd15ae879

View File

@@ -70,7 +70,7 @@ class Colorizer {
fun getIncomingGroupSenderColor(context: Context, recipient: Recipient): Int {
return if (groupMembers.isEmpty()) {
groupSenderColors[recipient.id]?.getColor(context) ?: getDefaultColor(context, recipient)
} else {
} else if (recipient.hasServiceId) {
val memberPosition = groupMembers.indexOf(recipient.requireServiceId())
if (memberPosition >= 0) {
@@ -79,6 +79,8 @@ class Colorizer {
} else {
getDefaultColor(context, recipient)
}
} else {
getDefaultColor(context, recipient)
}
}