Fix for server crash when adding device group notification, #3498
Ylian Saint-Hilaire committed
Jan 20, 2022 at 17:56 UTC
5d6d704d2cc673e1666fb0598fe7abc6ee932e44
1 file changed
+2
meshuser.js
+2
@@ -1592,7 +1592,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
1592
if (err != null) { if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'changemeshnotify', responseid: command.responseid, result: err })); } catch (ex) { } } break; }
1593
1594
// Change the device group notification
1595
+ if (user.links == null) { user.links = {}; }
1596
if (user.links[command.meshid]) {
1597
+ // The user has direct rights for this device group
1598
if (command.notify == 0) {
1599
delete user.links[command.meshid].notify;
1600
} else {