summary refs log tree commit diff
path: root/gateway/src/opcodes/LazyRequest.ts
diff options
context:
space:
mode:
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",