diff --git a/services/libs/integrations/src/integrations/reddit/api/getMoreComments.ts b/services/libs/integrations/src/integrations/reddit/api/getMoreComments.ts index 89cb1db369..bcb1bd0017 100644 --- a/services/libs/integrations/src/integrations/reddit/api/getMoreComments.ts +++ b/services/libs/integrations/src/integrations/reddit/api/getMoreComments.ts @@ -37,7 +37,7 @@ async function getMoreComments( url: `http://oauth.reddit.com/api/morechildren?api_type=json`, params: { depth: 99, - link_id: input.postId, + link_id: `t3_${input.postId}`, children: input.children, }, headers: { diff --git a/services/libs/integrations/src/integrations/reddit/processStream.ts b/services/libs/integrations/src/integrations/reddit/processStream.ts index ae375410d9..ac23b0fe60 100644 --- a/services/libs/integrations/src/integrations/reddit/processStream.ts +++ b/services/libs/integrations/src/integrations/reddit/processStream.ts @@ -156,7 +156,11 @@ const processMoreCommentStream: ProcessStreamHandler = async (ctx) => { ctx, ) - const comments = response.json.data.things + const comments = response?.json?.data?.things + + if (!comments) { + return + } if (comments.length === 0) { return