diff --git a/src/js/index.js b/src/js/index.js index 0c94ff164..02afe1540 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -193,6 +193,8 @@ var RSTATES ={ app.filter('installError', function () { return function (app) { + if (!app) return false; + if (app.installationState === ISTATES.ERROR) return true; if (app.installationState === ISTATES.INSTALLED) { // app.health can also be null to indicate insufficient data @@ -224,6 +226,18 @@ app.filter('appIsInstalledAndHealthy', function () { }; }); +app.filter('applicationLink', function() { + return function(app) { + if (!app) return ''; + + if (app.installationState === ISTATES.INSTALLED && app.health === HSTATES.HEALTHY && app.runState === RSTATES.RUNNING && !app.pendingPostInstallConfirmation) { + return 'https://' + app.fqdn; + } else { + return ''; + } + }; +}); + app.filter('activeOAuthClients', function () { return function (clients, user) { return clients.filter(function (c) { return user.admin || (c.activeTokens && c.activeTokens.length > 0); }); @@ -375,16 +389,6 @@ app.filter('inProgressApps', function () { }; }); -app.filter('applicationLink', function() { - return function(app) { - if (app.installationState === ISTATES.INSTALLED && app.health === HSTATES.HEALTHY && app.runState === RSTATES.RUNNING && !app.pendingPostInstallConfirmation) { - return 'https://' + app.fqdn; - } else { - return ''; - } - }; -}); - app.filter('prettyHref', function () { return function (input) { if (!input) return input;