From a6e4239e7deb744a8bae8b4bc02b20fef466fec4 Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Wed, 5 Oct 2022 12:32:48 +0200 Subject: [PATCH] Handle case when this.element is undefined outlet --- ui/packages/consul-ui/app/components/outlet/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/packages/consul-ui/app/components/outlet/index.js b/ui/packages/consul-ui/app/components/outlet/index.js index e63ec68e21..693cdbeed6 100644 --- a/ui/packages/consul-ui/app/components/outlet/index.js +++ b/ui/packages/consul-ui/app/components/outlet/index.js @@ -79,10 +79,14 @@ export default class Outlet extends Component { this.previousState = this.state; this.state = new State('loading'); this.endTransition = this.routlet.transition(); - // if we have no transition-duration set immediately end the transition - const duration = window - .getComputedStyle(this.element) - .getPropertyValue('transition-duration'); + let duration; + if (this.element) { + // if we have no transition-duration set immediately end the transition + duration = window.getComputedStyle(this.element).getPropertyValue('transition-duration'); + } else { + duration = 0; + } + if (parseFloat(duration) === 0) { this.endTransition(); }