also check content and content.users before proceeding

pull/21833/head
Bruno Windels 2019-07-12 18:50:13 +02:00
parent 78ba22d12e
commit 5c7e9812a1
1 changed files with 2 additions and 1 deletions

View File

@ -416,7 +416,8 @@ function textForEncryptionEvent(event) {
// Currently will only display a change if a user's power level is changed
function textForPowerEvent(event) {
const senderName = event.sender ? event.sender.name : event.getSender();
if (!event.getPrevContent() || !event.getPrevContent().users) {
if (!event.getPrevContent() || !event.getPrevContent().users ||
!event.getContent() || !event.getContent().users) {
return '';
}
const userDefault = event.getContent().users_default || 0;