Don't error out if router is not yet setup

When router is not set up yet sending events to it will fail. If that's
the case, we can just swallow the error, because afterSignIn will take
effect only if we are already in some state in the router.
This commit is contained in:
Piotr Sarnacki 2013-06-05 12:43:24 +02:00
parent 50cdc4cf98
commit 0d12176239

View File

@ -70,7 +70,10 @@
if router = Travis.__container__.lookup('router:main')
path = @readAfterSignInPath()
Ember.run.next =>
router.send('afterSignIn', path)
try
router.send('afterSignIn', path)
catch e
throw e unless e =~ /There are no active handlers/
@refreshUserData(data.user)
refreshUserData: (user) ->