chore: Check file size before loading

This commit is contained in:
krille-chan 2024-12-01 12:26:20 +01:00
parent b6808535ab
commit 63d5d6e61f
No known key found for this signature in database

View file

@ -66,6 +66,9 @@ class SendFileDialogState extends State<SendFileDialog> {
scaffoldMessenger.showLoadingSnackBar(l10n.generatingVideoThumbnail);
thumbnail = await xfile.getVideoThumbnail();
} else {
if (length > maxUploadSize) {
throw FileTooBigMatrixException(length, maxUploadSize);
}
// Else we just create a MatrixFile
file = MatrixFile(
bytes: await xfile.readAsBytes(),