From c60880fd91ad9e253176f54fbe1bfe4fbb2c1038 Mon Sep 17 00:00:00 2001 From: iyear Date: Sat, 10 Jun 2023 22:45:36 +0800 Subject: [PATCH] fix(export): nil media with --all flag --- app/chat/export.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/chat/export.go b/app/chat/export.go index f2c9aa0770..a4b6c15840 100644 --- a/app/chat/export.go +++ b/app/chat/export.go @@ -200,10 +200,14 @@ func Export(ctx context.Context, opts *ExportOptions) error { if opts.Raw { jsonMessage = m } else { + fileName := "" + if media != nil { // #207 + fileName = media.Name + } t := &Message{ ID: m.ID, Type: "message", - File: media.Name, + File: fileName, } if opts.WithContent { t.Date = m.Date