fix location crashing server #7626
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Feb 24, 2026 at 16:08 UTC
943a391f48f86495e6a4b004c3155c3e0f48768e
1 file changed
+2
-2
meshagent.js
+2
-2
@@ -1933,7 +1933,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1933
if (!device.lastbootuptime) { device.lastbootuptime = ""; }
1934
if (device.lastbootuptime != command.lastbootuptime) { /*changes.push('Last Boot Up Time');*/ device.lastbootuptime = command.lastbootuptime; change = 1; log = 1; }
1935
}
1936
-if (command.idletime != null) { // Idle Time
1936
+ if (command.idletime != null) { // Idle Time
1937
if (!device.idletime) { device.idletime = 0; }
1938
if (parseInt(device.idletime) != parseInt(command.idletime)) { /*changes.push('Idle Time');*/ device.idletime = parseInt(command.idletime); change = 1; } // Don't log idle time changes, this is too volatile.
1939
}
@@ -1985,7 +1985,7 @@ if (command.idletime != null) { // Idle Time
1985
1986
// Change the current core information string and event it
1987
function ChangeAgentLocationInfo(command) {
1988
- if (obj.agentInfo.capabilities & 0x40) return;
1988
+ if ((obj.agentInfo == null) || (obj.agentInfo.capabilities & 0x40)) return;
1989
if ((command == null) || (command == null)) { return; } // Safety, should never happen.
1990
1991
// Check that the mesh exists