[Backport] Fixing js error when redirecting /login for anonymous users

stable
Alejandro Alonso 2015-08-17 08:06:01 +02:00
parent 606a58894a
commit 24c4ccc42c
1 changed files with 5 additions and 3 deletions

View File

@ -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",