Skip to content

Commit 38ae7a0

Browse files
committed
check ClientContext's this and _pcb once out of the ::connect() delay
fix #4078
1 parent b08ff10 commit 38ae7a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/ESP8266WiFi/src/include/ClientContext.h

+5
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ class ClientContext
131131
_op_start_time = millis();
132132
// This delay will be interrupted by esp_schedule in the connect callback
133133
delay(_timeout_ms);
134+
// WiFi may have vanished during the delay (#4078)
135+
if (!this || !_pcb) {
136+
DEBUGV(":vnsh\r\n");
137+
return 0;
138+
}
134139
_connect_pending = 0;
135140
if (state() != ESTABLISHED) {
136141
abort();

0 commit comments

Comments
 (0)