mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
check for nulls
This commit is contained in:
parent
2192a8b0ec
commit
bc901d613d
1 changed files with 19 additions and 4 deletions
|
@ -590,6 +590,13 @@ void PostgreSQL::initializeMembers()
|
||||||
|
|
||||||
initMember(config);
|
initMember(config);
|
||||||
|
|
||||||
|
if (row[0].is_null()) {
|
||||||
|
fprintf(stderr, "Null memberID?!?\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (row[1].is_null()) {
|
||||||
|
fprintf(stderr, "Null NetworkID?!?\n");
|
||||||
|
}
|
||||||
std::string memberId = row[0].as<std::string>();
|
std::string memberId = row[0].as<std::string>();
|
||||||
std::string networkId = row[1].as<std::string>();
|
std::string networkId = row[1].as<std::string>();
|
||||||
|
|
||||||
|
@ -625,11 +632,19 @@ void PostgreSQL::initializeMembers()
|
||||||
} catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
config["remoteTraceLevel"] = 0;
|
config["remoteTraceLevel"] = 0;
|
||||||
}
|
}
|
||||||
config["remoteTraceTarget"] = row[10].as<std::string>();
|
if (!config["remoteTraceTarget"].is_null()) {
|
||||||
try {
|
config["remoteTraceTarget"] = row[10].as<std::string>();
|
||||||
config["tags"] = json::parse(row[11].as<std::string>());
|
} else {
|
||||||
} catch (std::exception &e) {
|
config["remoteTraceTarget"] = "";
|
||||||
|
}
|
||||||
|
if (config["tags"].is_null()) {
|
||||||
config["tags"] = json::array();
|
config["tags"] = json::array();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
config["tags"] = json::parse(row[11].as<std::string>());
|
||||||
|
} catch (std::exception &e) {
|
||||||
|
config["tags"] = json::array();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
config["vMajor"] = row[12].as<int>();
|
config["vMajor"] = row[12].as<int>();
|
||||||
|
|
Loading…
Add table
Reference in a new issue