Fix bad assumption about attachment count in validator.

This commit is contained in:
Alex Hart
2025-04-15 10:14:54 -03:00
parent 6805826472
commit 416f80e745

View File

@@ -97,7 +97,7 @@ object SignalServiceProtoUtil {
val DataMessage.isInvalid: Boolean
get() {
if (isViewOnce == true) {
val contentType = attachments[0].contentType?.lowercase()
val contentType = attachments.getOrNull(0)?.contentType?.lowercase()
return attachments.size != 1 || !MediaUtil.isImageOrVideoType(contentType)
}
return false