summary refs log tree commit diff
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@proton.me>2023-12-05 16:52:30 -0500
committerPuyodead1 <puyodead@proton.me>2023-12-05 16:52:30 -0500
commit9c8a80693d5f6fcec7ae9a372c218a941726dfd9 (patch)
treef000e1c2b203b80ed9179ad6966f6017be37ef37
parentmessageupdate: fix member not being correct format (diff)
downloadserver-9c8a80693d5f6fcec7ae9a372c218a941726dfd9.tar.xz
handle possibly null activities in session sort
Diffstat (limited to '')
-rw-r--r--src/gateway/opcodes/LazyRequest.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gateway/opcodes/LazyRequest.ts b/src/gateway/opcodes/LazyRequest.ts
index 4ad1ae7b..3c21b708 100644
--- a/src/gateway/opcodes/LazyRequest.ts
+++ b/src/gateway/opcodes/LazyRequest.ts
@@ -57,7 +57,7 @@ const getMostRelevantSession = (sessions: Session[]) => {
 		return (
 			statusMap[a.status] -
 			statusMap[b.status] +
-			(a.activities.length - b.activities.length) * 2
+			((a.activities?.length ?? 0) - (b.activities?.length ?? 0)) * 2
 		);
 	});