avoid data error

This commit is contained in:
Qiuxia Fan 2022-06-23 15:49:39 +08:00
parent 2230702d97
commit 966195ce87

View File

@ -143,7 +143,7 @@ export function useSourceProcessor(
return {}; return {};
} }
const source: { [key: string]: unknown } = {}; const source: { [key: string]: unknown } = {};
const keys = Object.keys(resp.data); const keys = Object.keys((resp && resp.data) || {});
config.metricTypes.forEach((type: string, index) => { config.metricTypes.forEach((type: string, index) => {
const m = config.metrics[index]; const m = config.metrics[index];