From 5668b07a92372ae215b7e18109549b6842fb0883 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 6 Jun 2024 10:49:10 +0800 Subject: [PATCH] Check if redirectButton exists --- .../Pages/Account/LoggedOut.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js index 61dead22b4..afac70c9f4 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js @@ -1,6 +1,12 @@ -document.addEventListener('DOMContentLoaded', function (event) { +document.addEventListener("DOMContentLoaded", function (event) { setTimeout(function () { - window.clientName = document.getElementById("redirectButton").getAttribute("cname"); - window.location = document.getElementById('redirectButton').getAttribute('href'); - }, 3000); + var redirectButton = document.getElementById("redirectButton"); + + if(!redirectButton){ + return; + } + + redirectButton.getAttribute("cname"); + redirectButton.getAttribute("href"); + }, 3000) });