From 87d285893f51858db283cb63798245dd7c1da101 Mon Sep 17 00:00:00 2001 From: Yu Long Date: Mon, 21 Oct 2024 22:40:37 -0700 Subject: [PATCH] Fix not-null assertion bug from orig PR Signed-off-by: Yu Long --- pkg/ui/react-app/src/pages/graph/TimeInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ui/react-app/src/pages/graph/TimeInput.tsx b/pkg/ui/react-app/src/pages/graph/TimeInput.tsx index 72bc8e7d4e..cd4fdb2c1a 100644 --- a/pkg/ui/react-app/src/pages/graph/TimeInput.tsx +++ b/pkg/ui/react-app/src/pages/graph/TimeInput.tsx @@ -82,7 +82,7 @@ class TimeInput extends Component { this.$time.on('change.datetimepicker', (e: any) => { // The end time can also be set by dragging a section on the graph, // and that value will have decimal places. - if (e.date && e.date.valueOf() !== Math.trunc(this.props.time?.valueOf()!)) { + if (e.date && e.date.valueOf() !== Math.trunc(this.props.time?.valueOf() ?? 0)) { this.props.onChangeTime(e.date.valueOf()); } });