From decd2942c5386f388a8f37535035cb8a9ed2a34f Mon Sep 17 00:00:00 2001 From: tablatronix Date: Tue, 18 Feb 2020 15:09:42 -0600 Subject: [PATCH] fix param out of scope check in doparamsave --- WiFiManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index f4872d3..f8f0e6a 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -1408,8 +1408,10 @@ void WiFiManager::doParamSave(){ if(_paramsCount > 0){ DEBUG_WM(DEBUG_VERBOSE,F("Parameters")); DEBUG_WM(DEBUG_VERBOSE,FPSTR(D_HR)); + for (int i = 0; i < _paramsCount; i++) { - if (_params[i] == NULL) { + if (_params[i] == NULL || _params[i]->_length == 0) { + DEBUG_WM(DEBUG_ERROR,"[ERROR] WiFiManagerParameter is out of scope"); break; // @todo might not be needed anymore } //read parameter from server