mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 18:36:06 +08:00
fix: add safety checks to handle null response from query range API (#4939)
This commit is contained in:
parent
64bf580323
commit
e78e1d4b63
@ -59,7 +59,7 @@ function WidgetGraphComponent({
|
|||||||
|
|
||||||
const lineChartRef = useRef<ToggleGraphProps>();
|
const lineChartRef = useRef<ToggleGraphProps>();
|
||||||
const [graphVisibility, setGraphVisibility] = useState<boolean[]>(
|
const [graphVisibility, setGraphVisibility] = useState<boolean[]>(
|
||||||
Array(queryResponse.data?.payload?.data.result.length || 0).fill(true),
|
Array(queryResponse.data?.payload?.data?.result?.length || 0).fill(true),
|
||||||
);
|
);
|
||||||
const graphRef = useRef<HTMLDivElement>(null);
|
const graphRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ export const getUPlotChartOptions = ({
|
|||||||
y: {
|
y: {
|
||||||
...getYAxisScale({
|
...getYAxisScale({
|
||||||
thresholds,
|
thresholds,
|
||||||
series: apiResponse?.data.newResult.data.result,
|
series: apiResponse?.data?.newResult?.data?.result || [],
|
||||||
yAxisUnit,
|
yAxisUnit,
|
||||||
softMax,
|
softMax,
|
||||||
softMin,
|
softMin,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user