Skip to content

Commit bc2b7a5

Browse files
author
Bjornskjald
committed
2.3.3: Fixed errors on unavailable attachments
2 parents 693a933 + e09c892 commit bc2b7a5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "libfb",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "Facebook MQTT library for Node.js",
55
"repository": "https://github.com/ChatPlug/libfb-js",
66
"main": "dist/index.js",

src/types/attachments/parseXMAAttachment.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import {
99
import { parse } from 'url'
1010
import vm from 'vm'
1111

12-
export default function parseXMAAttachment (attach: any) {
13-
attach = attach[Object.keys(attach)[0]].story_attachment
12+
export default function parseXMAAttachment (xma: any) {
13+
const attach = xma[Object.keys(xma)[0]].story_attachment
1414
if (!attach.target || !attach.target.__type__) {
1515
return {
1616
type: 'UnavailableXMA',
17-
message: attach.description.text,
18-
attach
17+
message: attach.description ? attach.description.text : 'Attachment unavailable',
18+
attach: xma
1919
} as UnavailableXMA
2020
}
2121
const type = attach.target.__type__.name

0 commit comments

Comments
 (0)