Fixing js error when redirecting /login for anonymous users

stable
Alejandro Alonso 2015-08-17 08:06:01 +02:00
parent ea7e5ebf49
commit 77b491fd0d
1 changed files with 5 additions and 3 deletions

View File

@ -1,8 +1,10 @@
WorkingOnDirective = (homeService, currentUserService) -> WorkingOnDirective = (homeService, currentUserService) ->
link = (scope, el, attrs, ctrl) -> link = (scope, el, attrs, ctrl) ->
userId = currentUserService.getUser().get("id") user = currentUserService.getUser()
# If we are not logged in the user will be null
ctrl.getWorkInProgress(userId) if user
userId = user.get("id")
ctrl.getWorkInProgress(userId)
return { return {
controller: "WorkingOn", controller: "WorkingOn",