Skip to content

Commit 6cd0cea

Browse files
committed
fix: 确保 api.list 存在且不为空
1 parent 4766bdc commit 6cd0cea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default async (config: Config): Promise<void> => {
1414
consola.info('生成 TypeScript 类型文件中...')
1515
// 生成分类 ID 到分类 API 列表的对象
1616
const categoryIdToApiList = apiCollection.reduce<{ [id: number]: ApiList }>((res, api) => {
17-
if (api.list.length) {
17+
if (api && api.list && api.list.length) {
1818
res[api.list[0].catid] = api.list
1919
}
2020
return res

0 commit comments

Comments
 (0)