diff options
author | Erkin Alp Güney <erkinalp9035@gmail.com> | 2022-02-04 23:43:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 23:43:31 +0300 |
commit | 9940f342f9445a4a939f6aa7ee17c16d98dfc81b (patch) | |
tree | 9a9bf419503c6d8f129de75f830be61bb285c7a0 /api | |
parent | pretend self-bans don't exist in the views too (diff) | |
parent | Bump simple-get from 3.1.0 to 3.1.1 in /util (#620) (diff) | |
download | server-9940f342f9445a4a939f6aa7ee17c16d98dfc81b.tar.xz |
Merge branch 'master' into origin/dev/erkinalp/self-bans
Diffstat (limited to 'api')
-rw-r--r-- | api/src/routes/channels/#channel_id/messages/index.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts index 1ae9d676..5fdab623 100644 --- a/api/src/routes/channels/#channel_id/messages/index.ts +++ b/api/src/routes/channels/#channel_id/messages/index.ts @@ -126,6 +126,13 @@ router.get("/", async (req: Request, res: Response) => { y.proxy_url = `${endpoint == null ? "" : endpoint}${new URL(uri).pathname}`; }); + //Some clients ( discord.js ) only check if a property exists within the response, + //which causes erorrs when, say, the `application` property is `null`. + for (var curr in x) { + if (x[curr] === null) + delete x[curr]; + } + return x; }) ); |