diff --git a/packages/amis-core/src/store/crud.ts b/packages/amis-core/src/store/crud.ts index a9e57bdad..6aed7de77 100644 --- a/packages/amis-core/src/store/crud.ts +++ b/packages/amis-core/src/store/crud.ts @@ -289,8 +289,10 @@ export const CRUDStore = ServiceStore.named('CRUDStore') items = result.items || result.rows; } - // 如果不按照 items 格式返回,就拿第一个数组当成 items - if (!Array.isArray(items)) { + if (items == null) { + items = []; + } else if (!Array.isArray(items)) { + // 如果不按照 items 格式返回,就拿第一个数组当成 items for (const key of Object.keys(result)) { if (result.hasOwnProperty(key) && Array.isArray(result[key])) { items = result[key];