Improving readIP function
Change logic to first check if JsonVariant is a String.
This commit is contained in:
		@@ -77,7 +77,7 @@ void WiFiSettingsService::reconfigureWiFiConnection() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void WiFiSettingsService::readIP(JsonObject& root, String key, IPAddress& _ip){
 | 
					void WiFiSettingsService::readIP(JsonObject& root, String key, IPAddress& _ip){
 | 
				
			||||||
  if ( root[key].isNull() || !_ip.fromString(root[key].as<String>())){
 | 
					  if ( !root[key].is<String>() || !_ip.fromString(root[key].as<String>())){
 | 
				
			||||||
    _ip = INADDR_NONE;
 | 
					    _ip = INADDR_NONE;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user