Fix for server exception when connecting tools.

Ylian Saint-Hilaire committed Jun 14, 2021 at 17:48 UTC 5e7669e6d88948c873b9e9d7325932f445bf5789
2 files changed +1 -1
agents/MeshCentralRouter.exe
Binary files a/agents/MeshCentralRouter.exe and b/agents/MeshCentralRouter.exe differ
webserver.js
+1 -1
@@ -6262,7 +6262,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
6262 obj.authenticate(req.query.user, req.query.pass, domain, function (err, userid, passhint, loginOptions) {
6263
6264 // Check if user as the "notools" site right. If so, deny this connection as tools are not allowed to connect.
6265 - if ((user.siteadmin != 0xFFFFFFFF) && (user.siteadmin & SITERIGHT_NOMESHCMD)) {
6265 + if ((user != null) && (user.siteadmin != 0xFFFFFFFF) && (user.siteadmin & SITERIGHT_NOMESHCMD)) {
6266 // No tools allowed, close the websocket connection
6267 parent.debug('web', 'ERR: Websocket no tools allowed');
6268 try { ws.send(JSON.stringify({ action: 'close', cause: 'notools', msg: 'notools' })); ws.close(); } catch (e) { }