Skip to content

Commit 389e431

Browse files
committed
try fixing "null is not an object evaluating this.socket.ping"
1 parent 4c2dcc1 commit 389e431

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/structures/Node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,11 +1137,11 @@ export class LavalinkNode {
11371137
// every x ms send a ping to lavalink to retrieve a pong later on
11381138
this.heartBeatInterval = setInterval(() => {
11391139
if (!this.socket) return console.error("Node-Heartbeat-Interval - Socket not available - maybe reconnecting?");
1140-
if (!this.isAlive) this.close(500, "Node-Heartbeat-Timeout");
1140+
if (!this.isAlive) return this.close(500, "Node-Heartbeat-Timeout");
11411141

11421142
this.isAlive = false;
11431143
this.heartBeatPingTimestamp = performance.now();
1144-
this.socket.ping();
1144+
this.socket?.ping?.();
11451145
}, this.options.heartBeatInterval || 30_000);
11461146
}
11471147

0 commit comments

Comments
 (0)