File tree Expand file tree Collapse file tree
src/common/backend/services/dida365 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ interface Dida365CheckResponse {
2525 closed : boolean ;
2626 groupId : string ;
2727 } [ ] ;
28- projectGroups : {
28+ projectGroups ? : {
2929 id : string ;
3030 name : string ;
3131 } [ ] ;
32- tags : {
32+ tags ? : {
3333 name : string ;
3434 } [ ] ;
3535}
@@ -84,9 +84,12 @@ export default class Dida365DocumentService implements DocumentService {
8484 getRepositories = async ( ) : Promise < Repository [ ] > => {
8585 const dida365CheckResponse = await this . request . get < Dida365CheckResponse > ( `batch/check/0` ) ;
8686 const groupMap = new Map < string , string > ( ) ;
87- dida365CheckResponse . projectGroups . forEach ( ( group ) => {
88- groupMap . set ( group . id , group . name ) ;
89- } ) ;
87+ if ( dida365CheckResponse . projectGroups ) { // 检查 projectGroups 是否存在
88+ dida365CheckResponse . projectGroups . forEach ( ( group ) => {
89+ groupMap . set ( group . id , group . name ) ;
90+ } ) ;
91+ }
92+
9093 return dida365CheckResponse . projectProfiles
9194 . filter ( ( o ) => ! o . closed )
9295 . map ( ( { id, name, groupId } ) => ( {
You can’t perform that action at this time.
0 commit comments