Skip to content

Commit

Permalink
Safeguard charts.time
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Aug 26, 2024
1 parent 49ccae5 commit e6d9635
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion locust/webui/src/components/LineChart/LineChart.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const createOptions = <ChartType extends Pick<ICharts, 'time'>>({
},
xAxis: {
type: 'time',
startValue: charts.time[0],
startValue: (charts.time || [''])[0],
axisLabel: {
formatter: formatTimeAxis,
},
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/src/redux/slice/ui.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const uiSlice = createSlice({
...addSpaceToChartsBetweenTests(state.charts as ICharts),
markers: (state.charts as ICharts).markers
? [...((state.charts as ICharts).markers as string[]), payload]
: [state.charts.time[0], payload],
: [(state.charts.time || [''])[0], payload],
},
};
},
Expand Down

0 comments on commit e6d9635

Please sign in to comment.