Skip to content

Commit

Permalink
handle empty route object
Browse files Browse the repository at this point in the history
  • Loading branch information
Yubin committed Nov 15, 2016
1 parent 575c2e3 commit b2386bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addon/core/transition-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ prototype.activateRoute = function activateRoute(route) {
prototype.routeFinishedSetup = function routeFinishedSetup(route) {
let endTime = t();
let [r] = this.routes.filter((r) => r.name === route.routeName);
r.endTime = endTime;
r.elapsedTime = r.endTime - r.startTime;

if (r) {
r.endTime = endTime;
r.elapsedTime = r.endTime - r.startTime;
}
};

prototype._viewAdded = function _viewAdded(view, index) {
Expand Down

0 comments on commit b2386bd

Please sign in to comment.