Fix error 'window is undefined' that may appear

- Avoid possible errors, because of 'window' is only defined on browser side but not in NodeJS on client side. Check for 'typeof window' is neccessary, because if it's not defined at all you can't check for 'window !== undefined' without the same error 'window is undefined'.
This commit is contained in:
Wolfgang Huß 2021-08-09 14:02:48 +02:00
parent 0ec33fe3a3
commit d4012ee3ca

View File

@ -34,7 +34,7 @@ class PageParams {
redirectToPage(thisComponent) {
if (this.isInternalPage) {
thisComponent.$router.push(this.internalPage.pageRoute)
} else {
} else if (typeof window !== 'undefined') {
window.location.href = this.externalLink
}
}