File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export namespace PostCatService {
2121 try {
2222 const resp = await req . getAll ( )
2323 const { categories } = < { categories : PostCat [ ] } > JSON . parse ( resp )
24+ if ( categories == null ) return [ ]
2425 return categories . map ( x => Object . assign ( new PostCat ( ) , x ) )
2526 } catch ( e ) {
2627 if ( await UserService . hasBlog ( ) ) void Alert . err ( `查询随笔分类失败: ${ < string > e } ` )
@@ -60,6 +61,7 @@ export namespace PostCatService {
6061 try {
6162 const resp = await req . getOne ( parentId )
6263 const { categories } = < { categories : PostCat [ ] } > JSON . parse ( resp )
64+ if ( categories == null ) return [ ]
6365 return categories . map ( x => Object . assign ( new PostCat ( ) , x ) )
6466 } catch ( e ) {
6567 if ( await UserService . hasBlog ( ) ) void Alert . err ( `查询随笔分类失败: ${ < string > e } ` )
You can’t perform that action at this time.
0 commit comments