1717import org .springframework .web .reactive .function .BodyInserters ;
1818import reactor .core .publisher .Mono ;
1919
20+ import java .util .ArrayList ;
2021import java .util .Map ;
22+ import java .util .Objects ;
2123
2224@ RequiredArgsConstructor
2325@ RestController
@@ -48,7 +50,7 @@ private Mono<ResponseEntity<Resource>> forwardToNodeService(String applicationId
4850 String withoutLeadingSlash = path .startsWith ("/" ) ? path .substring (1 ) : path ;
4951 if (applicationId .equals ("none" )) {
5052 return sessionUserService .getVisitorOrgMemberCache ().flatMap (orgMember -> organizationService .getOrgCommonSettings (orgMember .getOrgId ()).flatMap (organizationCommonSettings -> {
51- Map <String , Object > config = Map .of ("npmRegistries" , organizationCommonSettings .get ("npmRegistries" ), "workspaceId" , orgMember .getOrgId ());
53+ Map <String , Object > config = Map .of ("npmRegistries" , Objects . requireNonNullElse ( organizationCommonSettings .get ("npmRegistries" ), new ArrayList <>( 0 ) ), "workspaceId" , orgMember .getOrgId ());
5254 return WebClientBuildHelper .builder ()
5355 .systemProxy ()
5456 .build ()
@@ -66,7 +68,7 @@ private Mono<ResponseEntity<Resource>> forwardToNodeService(String applicationId
6668 }));
6769 } else {
6870 return applicationServiceImpl .findById (applicationId ).flatMap (application -> organizationService .getById (application .getOrganizationId ())).flatMap (orgMember -> organizationService .getOrgCommonSettings (orgMember .getId ()).flatMap (organizationCommonSettings -> {
69- Map <String , Object > config = Map .of ("npmRegistries" , organizationCommonSettings .get ("npmRegistries" ), "workspaceId" , orgMember .getId ());
71+ Map <String , Object > config = Map .of ("npmRegistries" , Objects . requireNonNullElse ( organizationCommonSettings .get ("npmRegistries" ), new ArrayList <>( 0 ) ), "workspaceId" , orgMember .getId ());
7072 return WebClientBuildHelper .builder ()
7173 .systemProxy ()
7274 .build ()
0 commit comments