Browse Source

SendFileController: Only process preview if not null

Danilo Bargen 7 years ago
parent
commit
74b18538c6
1 changed files with 7 additions and 5 deletions
  1. 7 5
      src/partials/messenger.ts

+ 7 - 5
src/partials/messenger.ts

@@ -91,11 +91,13 @@ class SendFileController extends DialogController {
                 preview: threema.FileMessageData) {
         super($mdDialog, CONFIG);
         this.preview = preview;
-        this.previewDataUrl = bufferToUrl(
-            this.preview.data,
-            this.preview.fileType,
-            logAdapter($log.warn, this.logTag),
-        );
+        if (preview !== null) {
+            this.previewDataUrl = bufferToUrl(
+                this.preview.data,
+                this.preview.fileType,
+                logAdapter($log.warn, this.logTag),
+            );
+        }
     }
 
     public send(): void {