From a4d63e713d44b277001a0b044d4cf44d6a5692fe Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 6 Dec 2020 22:24:51 -0800 Subject: [PATCH] Fixed rare server exception. --- meshagent.js | 1 + 1 file changed, 1 insertion(+) diff --git a/meshagent.js b/meshagent.js index dfeef119..d288ef21 100644 --- a/meshagent.js +++ b/meshagent.js @@ -261,6 +261,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { obj.agentUpdate.buf[2] = 0; obj.agentUpdate.buf[3] = 1; parent.fs.read(obj.agentUpdate.fd, obj.agentUpdate.buf, 4, parent.parent.agentUpdateBlockSize, obj.agentUpdate.ptr, function (err, bytesRead, buffer) { + if (obj.agentUpdate == null) return; if ((err != null) || (bytesRead == 0)) { // Error reading the agent file, stop here. try { parent.fs.close(obj.agentUpdate.fd); } catch (ex) { }