Fix settings so it doesn't overwrite node password
This commit is contained in:
parent
48bb13b965
commit
8b4f2cb994
1 changed files with 4 additions and 1 deletions
|
@ -276,7 +276,10 @@ void onApiSettingsPost(AsyncWebServerRequest *request)
|
|||
if (request->hasParam(v, true))
|
||||
{
|
||||
AsyncWebParameter *pv = request->getParam(v, true);
|
||||
preferences.putString(v.c_str(), pv->value().c_str());
|
||||
// Don't store an empty password, probably new settings save
|
||||
if (!(v.equals("rpcPass") && pv->value().length() == 0)) {
|
||||
preferences.putString(v.c_str(), pv->value().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue