diff options
Diffstat (limited to 'controller')
-rw-r--r-- | controller/PostgreSQL.cpp | 12 |
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) { |