Skip to content

Commit e92f4e6

Browse files
committed
fix: ON_STA_FILTER & ON_AP_FILTER
1 parent ebd832c commit e92f4e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/WebServer/src/WebServer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,10 @@ String WebServer::_responseCodeToString(int code) {
806806

807807
#if SOC_WIFI_SUPPORTED
808808
bool ON_STA_FILTER(WebServer &server) {
809-
return WiFi.STA.localIP() == server.client().localIP();
809+
return WiFi.STA.hasIP() && WiFi.STA.localIP() == server.client().localIP();
810810
}
811811

812812
bool ON_AP_FILTER(WebServer &server) {
813-
return WiFi.AP.localIP() == server.client().localIP();
813+
return WiFi.AP.hasIP() && WiFi.AP.localIP() == server.client().localIP();
814814
}
815815
#endif

0 commit comments

Comments
 (0)