Skip to content

Commit 8da45e8

Browse files
committed
support for quoted tweet not found
1 parent 2a0cb76 commit 8da45e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/http/post-index/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ exports.handler = async function http(req) {
104104
if (!checkIfContainsVideoOrGif(data)) {
105105
if (data.quoted_status_id) {
106106
// If it is a quoted tweet, we find the data for the tweet quoted
107-
data = data.quoted_status;
107+
if (!data.quoted_status) throw new Error(610);
108+
else data = data.quoted_status;
108109
// Check for the video in the quoted tweet. If we still can't find video, we throw error
109110
if (!checkIfContainsVideoOrGif(data)) throw new Error(605);
110111
} else throw new Error(605);
@@ -146,6 +147,7 @@ exports.handler = async function http(req) {
146147
606: "Shortcut compromised.",
147148
607: "Outdated shortcut version.",
148149
608: "Cannot resolve URL redirect",
150+
610: "Quoted tweet not found.",
149151
};
150152

151153
let error;

0 commit comments

Comments
 (0)