From ac8ae54841c38a4f5f174c0ee8ce7f1edb6c9e66 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 9 Oct 2017 17:01:25 +0200 Subject: [PATCH] Follow up for issue #1276 - only set channel data if matrix exists. --- .../app/controllers/_profile/notification.coffee | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_profile/notification.coffee b/app/assets/javascripts/app/controllers/_profile/notification.coffee index d19b8ac21..3de8f3e2b 100644 --- a/app/assets/javascripts/app/controllers/_profile/notification.coffee +++ b/app/assets/javascripts/app/controllers/_profile/notification.coffee @@ -135,12 +135,13 @@ class Index extends App.ControllerSubContent } # check missing channels - for key, value of params['notification_config']['matrix'] - if !value.channel - value.channel = { - email: false - online: true - } + if params['notification_config'] + for key, value of params['notification_config']['matrix'] + if !value.channel + value.channel = { + email: false + online: true + } if !params.notification_config.group_ids || _.isEmpty(params.notification_config.group_ids) params.notification_config.group_ids = ['-']