Skip to content

Commit 49f7e36

Browse files
committed
Fix: not call disconnect if WiFi is not connected
1 parent 498c087 commit 49f7e36

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/WiFi/src/WiFi.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ void arduino::WiFiClass::ensureDefaultAPNetworkConfiguration() {
110110
}
111111

112112
void arduino::WiFiClass::end() {
113-
disconnect();
113+
if(_currentNetworkStatus == WL_CONNECTED) {
114+
disconnect();
115+
}
114116
_softAP = nullptr;
115117
}
116118

0 commit comments

Comments
 (0)