From 58c44ad1ead7ac0ae9b0e7a3375b591f4d50fb09 Mon Sep 17 00:00:00 2001 From: LP B Date: Fri, 24 Jun 2022 17:35:35 +0200 Subject: [PATCH] fix(app/account): ensure newTransition exists in uiCanExit [EE-3336] (#7110) --- app/portainer/views/account/accountController.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/portainer/views/account/accountController.js b/app/portainer/views/account/accountController.js index 7c02f4c41..58868893e 100644 --- a/app/portainer/views/account/accountController.js +++ b/app/portainer/views/account/accountController.js @@ -48,11 +48,13 @@ angular.module('portainer.app').controller('AccountController', [ }; this.uiCanExit = (newTransition) => { - if ($scope.userRole === 1 && newTransition && newTransition.to().name === 'portainer.settings.authentication') { - return true; - } - if (newTransition.to().name === 'portainer.logout') { - return true; + if (newTransition) { + if ($scope.userRole === 1 && newTransition.to().name === 'portainer.settings.authentication') { + return true; + } + if (newTransition.to().name === 'portainer.logout') { + return true; + } } if ($scope.forceChangePassword) { ModalService.confirmForceChangePassword();