Browse Source

ref(dashboards): Add an optional check before accessing length (#36229)

Fixes JAVASCRIPT-27EA
Nar Saynorath 2 years ago
parent
commit
74956afc36
1 changed files with 1 additions and 1 deletions
  1. 1 1
      static/app/views/dashboardsV2/widgetCard/chart.tsx

+ 1 - 1
static/app/views/dashboardsV2/widgetCard/chart.tsx

@@ -210,7 +210,7 @@ class WidgetCardChart extends Component<WidgetCardChartProps, State> {
         tableMeta[field] = 'string';
       }
 
-      if (!field || !result.data.length) {
+      if (!field || !result.data?.length) {
         return <BigNumber key={`big_number:${result.title}`}>{'\u2014'}</BigNumber>;
       }