Fix a couple of warnings (#6445)

* Fix a couple of warnings

* fix build error

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Thomas Göttgens
2025-03-29 14:14:24 +01:00
committed by GitHub
parent 7df327664e
commit 3148e7277d
8 changed files with 26 additions and 23 deletions

View File

@@ -1061,8 +1061,8 @@ void NodeDB::loadFromDisk()
// if (state != LoadFileResult::LOAD_SUCCESS) {
// installDefaultDeviceState(); // Our in RAM copy might now be corrupt
//} else {
if (devicestate.version < DEVICESTATE_MIN_VER) {
LOG_WARN("Devicestate %d is old, discard", devicestate.version);
if ((state != LoadFileResult::LOAD_SUCCESS) || (devicestate.version < DEVICESTATE_MIN_VER)) {
LOG_WARN("Devicestate %d is old or invalid, discard", devicestate.version);
installDefaultDeviceState();
} else {
LOG_INFO("Loaded saved devicestate version %d", devicestate.version);