Просмотр исходного кода

fix(messages_list): prevent panic on failed attachment download (#660)

Ayyan 4 месяцев назад
Родитель
Сommit
07914616af
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      cmd/messages_list.go

+ 1 - 0
cmd/messages_list.go

@@ -497,6 +497,7 @@ func (ml *messagesList) openAttachment(attachment discord.Attachment) {
 	resp, err := http.Get(attachment.URL)
 	if err != nil {
 		slog.Error("failed to fetch the attachment", "err", err, "url", attachment.URL)
+		return
 	}
 	defer resp.Body.Close()