From 6d70d4e83f9b4ebfb68113e809ecdaa57be6ffe5 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Mon, 19 Jun 2017 13:11:00 +0800 Subject: [PATCH] fix(core): getCountUnread error when guest access --- .../core/client/controllers/header.client.controller.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/core/client/controllers/header.client.controller.js b/modules/core/client/controllers/header.client.controller.js index 662bb6b5..ab99953b 100644 --- a/modules/core/client/controllers/header.client.controller.js +++ b/modules/core/client/controllers/header.client.controller.js @@ -72,9 +72,11 @@ }; vm.getCountUnread = function () { - MessagesService.countUnread(function (data) { - vm.unreadCount = data.countFrom + data.countTo; - }); + if (Authentication.user) { + MessagesService.countUnread(function (data) { + vm.unreadCount = data.countFrom + data.countTo; + }); + } }; /**