Skip to content

Commit

Permalink
Set config.yaml defaults even if General is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-bennett authored and fifieldt committed Nov 29, 2024
1 parent ac6b6c8 commit 3c57a9c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/platform/portduino/PortduinoGlue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,9 @@ bool loadConfig(const char *configPath)
settingsStrings[webserverrootpath] = (yamlConfig["Webserver"]["RootPath"]).as<std::string>("");
}

if (yamlConfig["General"]) {
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as<std::string>("");
}
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as<std::string>("");

} catch (YAML::Exception &e) {
std::cout << "*** Exception " << e.what() << std::endl;
Expand Down

0 comments on commit 3c57a9c

Please sign in to comment.