Added code guards.
This commit is contained in:
parent
79ce9b7f71
commit
7709481345
|
@ -1637,6 +1637,7 @@
|
|||
}
|
||||
case 'accountchange': {
|
||||
// An account was created or changed
|
||||
if ((typeof message.event.account != 'object') || (message.event.account == null)) { console.log(message.event); return; };
|
||||
if (userinfo.name == message.event.account.name) {
|
||||
var newsiteadmin = message.event.account.siteadmin ? message.event.account.siteadmin : 0;
|
||||
var oldsiteadmin = userinfo.siteadmin ? userinfo.siteadmin : 0;
|
||||
|
|
|
@ -2693,6 +2693,7 @@
|
|||
case 'accountcreate':
|
||||
case 'accountchange': {
|
||||
// An account was created or changed
|
||||
if ((typeof message.event.account != 'object') || (message.event.account == null)) console.log(message.event); return;
|
||||
if (userinfo._id == message.event.account._id) {
|
||||
var newsiteadmin = message.event.account.siteadmin?message.event.account.siteadmin:0;
|
||||
var oldsiteadmin = userinfo.siteadmin?userinfo.siteadmin:0;
|
||||
|
|
Loading…
Reference in New Issue