1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-03-14 13:44:58 +00:00

Compare commits

...

7 Commits

Author SHA1 Message Date
ceffe2b7b3
Merge pull request #316 from joyfullservice/master
Update key verification syntax
2024-11-06 09:32:25 +01:00
joyfullservice
c42c40d881 Update key verification syntax
Resolve deprecation warnings for changes in ArduinoJson. See: https://arduinojson.org/v7/api/jsondocument/containskey/
2024-10-04 16:14:41 -05:00
0ceb052a2e
Merge pull request #315 from joyfullservice/master
Resolve null pointer exception
2024-09-28 16:45:28 +02:00
joyfullservice
8c729ee0da Remove unneeded arguments from separator function
Implement an alternate strategy for avoiding the null pointer exception. This takes the same approach as the function to add a label.
2024-09-27 09:29:03 -05:00
joyfullservice
8ca8241547 Resolve null pointer exception
Adding a separator using `ESPUI.separator("Separator name");` triggers an exception when the code tries to access the property of an invalid object.
2024-09-25 15:07:13 -05:00
66340823db
Merge pull request #314 from telesyst/Original
Update ESPUI.cpp
2024-09-02 21:13:09 +02:00
Nikola Kirov
25250dd026
Update ESPUI.cpp
Captive Portal memory leak (~2KB) fix
2024-08-31 20:05:40 +03:00
2 changed files with 3 additions and 4 deletions

View File

@ -660,7 +660,7 @@ uint16_t ESPUIClass::gauge(const char* label, ControlColor color, int number, in
uint16_t ESPUIClass::separator(const char* label) uint16_t ESPUIClass::separator(const char* label)
{ {
return addControl(ControlType::Separator, label, "", ControlColor::Alizarin, Control::noParent, nullptr); return addControl(ControlType::Separator, label, "", ControlColor::Alizarin);
} }
uint16_t ESPUIClass::fileDisplay(const char* label, ControlColor color, String filename) uint16_t ESPUIClass::fileDisplay(const char* label, ControlColor color, String filename)
@ -1264,7 +1264,6 @@ void ESPUIClass::begin(const char* _title, const char* username, const char* pas
responseText += ("</body></html><head><meta http-equiv=\"Refresh\" content=\"0; URL='http://" + WiFi.softAPIP().toString() + "'\" /></head>"); responseText += ("</body></html><head><meta http-equiv=\"Refresh\" content=\"0; URL='http://" + WiFi.softAPIP().toString() + "'\" /></head>");
response->write(responseText.c_str(), responseText.length()); response->write(responseText.c_str(), responseText.length());
request->send(response); request->send(response);
request->redirect("/");
} }
else else
{ {

View File

@ -310,14 +310,14 @@ uint32_t ESPUIclient::prepareJSONChunk(uint16_t startindex,
break; break;
} }
if(!FragmentRequest.containsKey(F("id"))) if(!FragmentRequest["id"].is<JsonVariant>())
{ {
Serial.println(F("ERROR:prepareJSONChunk:Fragmentation:Request does not contain a control ID")); Serial.println(F("ERROR:prepareJSONChunk:Fragmentation:Request does not contain a control ID"));
break; break;
} }
uint16_t ControlId = uint16_t(FragmentRequest[F("id")]); uint16_t ControlId = uint16_t(FragmentRequest[F("id")]);
if(!FragmentRequest.containsKey(F("offset"))) if(!FragmentRequest["offset"].is<JsonVariant>())
{ {
Serial.println(F("ERROR:prepareJSONChunk:Fragmentation:Request does not contain a starting offset")); Serial.println(F("ERROR:prepareJSONChunk:Fragmentation:Request does not contain a starting offset"));
break; break;