summary refs log tree commit diff
path: root/gateway/src/opcodes/LazyRequest.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-22 15:33:06 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-22 15:33:06 +1000
commitee98101e4c463910e1ca6dd099de13395cd9fa57 (patch)
tree318eda6258ee651a587accf1c440960269550382 /gateway/src/opcodes/LazyRequest.ts
parentPrevent lazyrequest when sent with guild_id as number (diff)
downloadserver-ee98101e4c463910e1ca6dd099de13395cd9fa57.tar.xz
LazyRequest on mobile + socket not closed fixes
Diffstat (limited to 'gateway/src/opcodes/LazyRequest.ts')
-rw-r--r--gateway/src/opcodes/LazyRequest.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/gateway/src/opcodes/LazyRequest.ts b/gateway/src/opcodes/LazyRequest.ts

index 0db35286..54b06eb2 100644 --- a/gateway/src/opcodes/LazyRequest.ts +++ b/gateway/src/opcodes/LazyRequest.ts
@@ -39,13 +39,16 @@ async function getMembers(guild_id: string, range: [number, number]) { } catch (e) { console.error(`LazyRequest`, e); + } + + if (!members) { return { items: [], groups: [], range: [], members: [], - } - } + }; + } const groups = [] as any[]; const items = []; @@ -157,7 +160,7 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { .flat() .unique(); - return Send(this, { + return await Send(this, { op: OPCODES.Dispatch, s: this.sequence++, t: "GUILD_MEMBER_LIST_UPDATE",