summaryrefslogtreecommitdiff
path: root/controller
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2018-11-11 22:55:53 -0800
committerGrant Limberg <grant.limberg@zerotier.com>2018-11-11 22:55:53 -0800
commit2729db9555d2c12b688dab5cb3eb620db7f4f904 (patch)
treecb15532ce3ec229a40ead19295bef394baa59d5f /controller
parent7048c77ebcbb74b257368bc50dfb16408229c994 (diff)
downloadinfinitytier-2729db9555d2c12b688dab5cb3eb620db7f4f904.tar.gz
infinitytier-2729db9555d2c12b688dab5cb3eb620db7f4f904.zip
exceptions
Diffstat (limited to 'controller')
-rw-r--r--controller/PostgreSQL.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp
index 02e2de2b..ea04f551 100644
--- a/controller/PostgreSQL.cpp
+++ b/controller/PostgreSQL.cpp
@@ -384,7 +384,11 @@ void PostgreSQL::initializeMembers(PGconn *conn)
config["nwid"] = networkId;
config["activeBridge"] = (strcmp(PQgetvalue(res, i, 2), "t") == 0);
config["authorized"] = (strcmp(PQgetvalue(res, i, 3), "t") == 0);
- config["capabilities"] = json::parse(PQgetvalue(res, i, 4));
+ try {
+ config["capabilities"] = json::parse(PQgetvalue(res, i, 4));
+ } catch (std::exception &e) {
+ config["capabilities"] = json::array();
+ }
try {
config["creationTime"] = std::stoull(PQgetvalue(res, i, 5));
} catch (std::exception &e) {
@@ -410,7 +414,11 @@ void PostgreSQL::initializeMembers(PGconn *conn)
config["remoteTraceLevel"] = 0;
}
config["remoteTraceTarget"] = PQgetvalue(res, i, 10);
- config["tags"] = json::parse(PQgetvalue(res, i, 11));
+ try {
+ config["tags"] = json::parse(PQgetvalue(res, i, 11));
+ } catch (std::exception &e) {
+ config["tags"] = json::array();
+ }
try {
config["vMajor"] = std::stoi(PQgetvalue(res, i, 12));
} catch(std::exception &e) {