From ef465f917c67b32cc4bea6d2d7c0818d07c1a196 Mon Sep 17 00:00:00 2001 From: brendan colloran Date: Wed, 21 Feb 2024 13:58:35 -0800 Subject: [PATCH] prevent crash from 3989 --- .../features/dashboards/time-dimension-details/util.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web-common/src/features/dashboards/time-dimension-details/util.ts b/web-common/src/features/dashboards/time-dimension-details/util.ts index e8af2c24f05..958b790d0c1 100644 --- a/web-common/src/features/dashboards/time-dimension-details/util.ts +++ b/web-common/src/features/dashboards/time-dimension-details/util.ts @@ -4,7 +4,15 @@ export function transposeArray(arr, rowCount, columnCount) { for (let i = 0; i < columnCount; i++) { const column = []; for (let j = 0; j < rowCount; j++) { - column.push(arr[j][i]); + try { + column.push(arr[j][i]); + } catch (e) { + column.push(null); + console.error( + `failed to access arr[${j}][${i}] during transpose of array ${arr}; see issue https://github.com/rilldata/rill/issues/3989`, + e, + ); + } } columnarBody.push(column); }