From 77b491fd0d642f425a1ad2f55b96f24099690633 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 17 Aug 2015 08:06:01 +0200 Subject: [PATCH] Fixing js error when redirecting /login for anonymous users --- app/modules/home/working-on/working-on.directive.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/modules/home/working-on/working-on.directive.coffee b/app/modules/home/working-on/working-on.directive.coffee index 2a806655..3e0cdaae 100644 --- a/app/modules/home/working-on/working-on.directive.coffee +++ b/app/modules/home/working-on/working-on.directive.coffee @@ -1,8 +1,10 @@ WorkingOnDirective = (homeService, currentUserService) -> link = (scope, el, attrs, ctrl) -> - userId = currentUserService.getUser().get("id") - - ctrl.getWorkInProgress(userId) + user = currentUserService.getUser() + # If we are not logged in the user will be null + if user + userId = user.get("id") + ctrl.getWorkInProgress(userId) return { controller: "WorkingOn",