Extra check message size

This commit is contained in:
M66B
2021-10-28 15:13:22 +02:00
parent 1ee3ef6f5e
commit bcbe88d9be
2 changed files with 4 additions and 3 deletions

View File

@@ -2007,8 +2007,9 @@ public class MessageHelper {
parts.addAll(text);
parts.addAll(extra);
for (PartHolder h : parts) {
if (h.part.getSize() > MAX_MESSAGE_SIZE) {
warnings.add(context.getString(R.string.title_insufficient_memory));
int size = h.part.getSize();
if (size > MAX_MESSAGE_SIZE && size != Integer.MAX_VALUE) {
warnings.add(context.getString(R.string.title_insufficient_memory, size));
return null;
}