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 {
21
21
try {
22
22
const resp = await req . getAll ( )
23
23
const { categories } = < { categories : PostCat [ ] } > JSON . parse ( resp )
24
+ if ( categories == null ) return [ ]
24
25
return categories . map ( x => Object . assign ( new PostCat ( ) , x ) )
25
26
} catch ( e ) {
26
27
if ( await UserService . hasBlog ( ) ) void Alert . err ( `查询随笔分类失败: ${ < string > e } ` )
@@ -60,6 +61,7 @@ export namespace PostCatService {
60
61
try {
61
62
const resp = await req . getOne ( parentId )
62
63
const { categories } = < { categories : PostCat [ ] } > JSON . parse ( resp )
64
+ if ( categories == null ) return [ ]
63
65
return categories . map ( x => Object . assign ( new PostCat ( ) , x ) )
64
66
} catch ( e ) {
65
67
if ( await UserService . hasBlog ( ) ) void Alert . err ( `查询随笔分类失败: ${ < string > e } ` )
You can’t perform that action at this time.
0 commit comments