Skip to content

Commit 50c5d70

Browse files
committed
fix: prevent errors when latency has not populated
1 parent 0a2828c commit 50c5d70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

interactions/api/gateway/websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def average_latency(self) -> float:
124124
@property
125125
def latency(self) -> float:
126126
"""Get the latency of the connection."""
127-
return self._latency[-1]
127+
return self._latency[-1] if self._latency else float("inf")
128128

129129
@property
130130
def loop(self) -> asyncio.AbstractEventLoop:

0 commit comments

Comments
 (0)