From fb6efb9e9a049ecd7985a50a902810484b0fc37a Mon Sep 17 00:00:00 2001 From: Geido <60598000+geido@users.noreply.github.com> Date: Thu, 8 Aug 2024 20:01:18 +0300 Subject: [PATCH] fix(PivotTable): Pass string only to safeHtmlSpan (#29895) --- .../src/react-pivottable/TableRenderers.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx index a9c5a29ff0c30..06085a42ad250 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx @@ -44,9 +44,10 @@ function displayHeaderCell( ) { const name = namesMapping[value] || value; const parsedLabel = parseLabel(name); - const labelContent = allowRenderHtml - ? safeHtmlSpan(parsedLabel) - : parsedLabel; + const labelContent = + allowRenderHtml && typeof parsedLabel === 'string' + ? safeHtmlSpan(parsedLabel) + : parsedLabel; return needToggle ? (