Handle if new node is added with no nearby systems
This commit is contained in:
@@ -136,7 +136,7 @@ exports.addNewNode = async (nodeObject, callback) => {
|
|||||||
ip = nodeObject.ip,
|
ip = nodeObject.ip,
|
||||||
port = nodeObject.port,
|
port = nodeObject.port,
|
||||||
location = nodeObject.location,
|
location = nodeObject.location,
|
||||||
nearbySystems = utils.JsonToBuffer(nodeObject.nearbySystems),
|
nearbySystems = utils.JsonToBuffer(nodeObject.nearbySystems ?? {}),
|
||||||
online = nodeObject.online
|
online = nodeObject.online
|
||||||
const sqlQuery = `INSERT INTO ${nodesTable} (name, ip, port, location, nearbySystems, online) VALUES ('${name}', '${ip}', ${port}, '${location}', '${nearbySystems}', ${online})`;
|
const sqlQuery = `INSERT INTO ${nodesTable} (name, ip, port, location, nearbySystems, online) VALUES ('${name}', '${ip}', ${port}, '${location}', '${nearbySystems}', ${online})`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user