Skip to content

Commit

Permalink
fix: fix error when submit response doesn't contain id
Browse files Browse the repository at this point in the history
  • Loading branch information
ekrzeptowski committed Mar 11, 2024
1 parent 481b5b8 commit 8bb0b58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/reddit/subreddit/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,9 @@ export class SubredditControls extends BaseControls {
submitResponse = await this.gateway.post("api/submit", request);
}
debugPost("Submit response %o", submitResponse);
return formatId(submitResponse.id as string);
return (
(submitResponse.id as string) && formatId(submitResponse.id as string)
);
}

/** @internal */
Expand Down

0 comments on commit 8bb0b58

Please sign in to comment.