diff --git a/packages/stream_chat_flutter/lib/src/message_input.dart b/packages/stream_chat_flutter/lib/src/message_input.dart index de2b9d09..a43359ee 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -1129,13 +1129,14 @@ class MessageInputState extends State { if (file.size! > widget.maxAttachmentSize) { if (medium.type == AssetType.video && file.path != null) { - final mediaInfo = await (VideoService.compressVideo( + final mediaInfo = await VideoService.compressVideo( file.path!, frameRate: widget.compressedVideoFrameRate, quality: widget.compressedVideoQuality, - ) as FutureOr); + ); - if (mediaInfo.filesize! > widget.maxAttachmentSize) { + if (mediaInfo == null || + mediaInfo.filesize! > widget.maxAttachmentSize) { _showErrorAlert( context.translations.fileTooLargeAfterCompressionError( widget.maxAttachmentSize / (1024 * 1024),