We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 693a933 commit 0f93e0cCopy full SHA for 0f93e0c
src/types/attachments/parseXMAAttachment.ts
@@ -9,13 +9,13 @@ import {
9
import { parse } from 'url'
10
import vm from 'vm'
11
12
-export default function parseXMAAttachment (attach: any) {
13
- attach = attach[Object.keys(attach)[0]].story_attachment
+export default function parseXMAAttachment (xma: any) {
+ const attach = xma[Object.keys(xma)[0]].story_attachment
14
if (!attach.target || !attach.target.__type__) {
15
return {
16
type: 'UnavailableXMA',
17
- message: attach.description.text,
18
- attach
+ message: attach.description ? attach.description.text : 'Attachment unavailable',
+ attach: xma
19
} as UnavailableXMA
20
}
21
const type = attach.target.__type__.name
0 commit comments