From 290295b26ac34f5e233788e557dee09240f0f58a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Elias=20M=C3=BCller?= <elias@elias-mueller.com>
Date: Sat, 6 May 2023 19:28:55 +0200
Subject: [PATCH] Make only media downloadable in chatBubble.dart, preventing
 "null" errors

---
 lib/screen/pages/talk/chatBubble.dart | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/screen/pages/talk/chatBubble.dart b/lib/screen/pages/talk/chatBubble.dart
index 30d564a..e170b11 100644
--- a/lib/screen/pages/talk/chatBubble.dart
+++ b/lib/screen/pages/talk/chatBubble.dart
@@ -164,7 +164,9 @@ class ChatBubble {
         });
       },
       onTap: () {
-        FileElement.download(message.file!.path!, message.file?.name ?? "Datei", (progress) => {
+        if(message.file == null) return;
+
+        FileElement.download(message.file!.path!, message.file!.name, (progress) => {
           downloadProgress = progress,
         }, (result) => {
           downloadProgress = 0,