Skip to content

Commit bf75573

Browse files
author
DimitarTachev
committed
fix: clear the socket timer on timeout (avoid Cannot set property 'socket' of null on the next tick)
1 parent a3ebf5d commit bf75573

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/services/livesync/android-livesync-tool.ts

+4
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ export class AndroidLivesyncTool implements IAndroidLivesyncTool {
313313
const connectionTimer = setTimeout(() => {
314314
if (!isConnected) {
315315
isConnected = true;
316+
if (this.pendingConnectionData && this.pendingConnectionData.socketTimer) {
317+
clearTimeout(this.pendingConnectionData.socketTimer);
318+
}
319+
316320
reject(lastKnownError || new Error("Socket connection timeouted."));
317321
this.pendingConnectionData = null;
318322
}

0 commit comments

Comments
 (0)