Don't throw error when repo can't be find

When visiting page of repo that doesn't exist, we should not throw an
error. It still does not work as expected, redirecting to
/undefined/undefined, which should be addressed as well, but at least we
don't throw errors now.
This commit is contained in:
Piotr Sarnacki 2013-01-08 15:01:49 +01:00
parent 938aaafc71
commit ae9ff005d3

View File

@ -204,7 +204,7 @@ Travis.Router = Ember.Router.extend
dynamicSegmentPattern: "([^/#]+)"
connectOutlets: (router, repo) ->
unless repo.constructor == Travis.Repo
if repo && repo.constructor != Travis.Repo
repo = Travis.Repo.find(repo.id)
router.get('repoController').set 'repo', repo