Skip to content
Prev Previous commit
Next Next commit
fix: ON_STA_FILTER & ON_AP_FILTER
  • Loading branch information
ayushsharma82 committed Jun 12, 2024
commit e92f4e640c4aebb47235f5d290e39ea283957b5b
4 changes: 2 additions & 2 deletions libraries/WebServer/src/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,10 +806,10 @@ String WebServer::_responseCodeToString(int code) {

#if SOC_WIFI_SUPPORTED
bool ON_STA_FILTER(WebServer &server) {
return WiFi.STA.localIP() == server.client().localIP();
return WiFi.STA.hasIP() && WiFi.STA.localIP() == server.client().localIP();
}

bool ON_AP_FILTER(WebServer &server) {
return WiFi.AP.localIP() == server.client().localIP();
return WiFi.AP.hasIP() && WiFi.AP.localIP() == server.client().localIP();
}
#endif