From 63d5d6e61f7cb63711ce42531bc38259143531c6 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 1 Dec 2024 12:26:20 +0100 Subject: [PATCH] chore: Check file size before loading --- lib/pages/chat/send_file_dialog.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/pages/chat/send_file_dialog.dart b/lib/pages/chat/send_file_dialog.dart index f54f84d27..e027113a5 100644 --- a/lib/pages/chat/send_file_dialog.dart +++ b/lib/pages/chat/send_file_dialog.dart @@ -66,6 +66,9 @@ class SendFileDialogState extends State { 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(),