From b9bcc99663802f47a4cdd6ad043315692a23d3d8 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 29 Apr 2014 23:48:06 -0400 Subject: [PATCH] Fix NPE if the current route is null --- static/js/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/app.js b/static/js/app.js index 4dd16996f..8aed08782 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -4791,6 +4791,10 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi }); $rootScope.$on('$routeChangeSuccess', function (event, current, previous) { + $rootScope.current = current.$$route; + + if (!current.$$route) { return; } + if (current.$$route.title) { $rootScope.title = current.$$route.title; } @@ -4802,7 +4806,6 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi } $rootScope.fixFooter = !!current.$$route.fixFooter; - $rootScope.current = current.$$route; }); $rootScope.$on('$viewContentLoaded', function(event, current) {