From 02ec96cff1a162d385c0e0d5e81f43c155a29753 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 12 Jul 2019 18:50:13 +0200 Subject: [PATCH] also check content and content.users before proceeding --- src/TextForEvent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TextForEvent.js b/src/TextForEvent.js index 56598c6e06..e3c249df3f 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -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;