From cd35e3a5cbd1468a956ea24bc4ccbca48c4ffe04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 31 May 2022 14:56:13 +0200 Subject: [PATCH] Web: avoid error resizing the tasks table The tasks table resize function is called via `this.$nextTick()`, which means that the component can actually already be unmounted by the time the actual function call is performed. This is now detected & handled. --- web/app/src/components/jobs/TasksTable.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/app/src/components/jobs/TasksTable.vue b/web/app/src/components/jobs/TasksTable.vue index a19f9180..989d8856 100644 --- a/web/app/src/components/jobs/TasksTable.vue +++ b/web/app/src/components/jobs/TasksTable.vue @@ -200,6 +200,13 @@ export default { const table = this.tabulator.element; const tableContainer = table.parentElement; const outerContainer = tableContainer.parentElement; + if (!outerContainer) { + // This can happen when the component was removed before the function is + // called. This is possible due to the use of Vue's `nextTick()` + // function. + return; + } + const availableHeight = outerContainer.clientHeight - 12; // TODO: figure out where the -12 comes from. if (tableContainer.offsetParent != tableContainer.parentElement) {