Skip to content

Commit

Permalink
Merge pull request #1239 from lowcoder-org/feature-private-repo
Browse files Browse the repository at this point in the history
fix null registry settings
  • Loading branch information
FalkWolsky authored Oct 10, 2024
2 parents 31f1cac + 28cb379 commit 5dbcd8d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import org.springframework.web.reactive.function.BodyInserters;
import reactor.core.publisher.Mono;

import java.util.ArrayList;
import java.util.Map;
import java.util.Objects;

@RequiredArgsConstructor
@RestController
Expand Down Expand Up @@ -48,7 +50,7 @@ private Mono<ResponseEntity<Resource>> forwardToNodeService(String applicationId
String withoutLeadingSlash = path.startsWith("/") ? path.substring(1) : path;
if(applicationId.equals("none")) {
return sessionUserService.getVisitorOrgMemberCache().flatMap(orgMember -> organizationService.getOrgCommonSettings(orgMember.getOrgId()).flatMap(organizationCommonSettings -> {
Map<String, Object> config = Map.of("npmRegistries", organizationCommonSettings.get("npmRegistries"), "workspaceId", orgMember.getOrgId());
Map<String, Object> config = Map.of("npmRegistries", Objects.requireNonNullElse(organizationCommonSettings.get("npmRegistries"), new ArrayList<>(0)), "workspaceId", orgMember.getOrgId());
return WebClientBuildHelper.builder()
.systemProxy()
.build()
Expand All @@ -66,7 +68,7 @@ private Mono<ResponseEntity<Resource>> forwardToNodeService(String applicationId
}));
} else{
return applicationServiceImpl.findById(applicationId).flatMap(application -> organizationService.getById(application.getOrganizationId())).flatMap(orgMember -> organizationService.getOrgCommonSettings(orgMember.getId()).flatMap(organizationCommonSettings -> {
Map<String, Object> config = Map.of("npmRegistries", organizationCommonSettings.get("npmRegistries"), "workspaceId", orgMember.getId());
Map<String, Object> config = Map.of("npmRegistries", Objects.requireNonNullElse(organizationCommonSettings.get("npmRegistries"), new ArrayList<>(0)), "workspaceId", orgMember.getId());
return WebClientBuildHelper.builder()
.systemProxy()
.build()
Expand Down

0 comments on commit 5dbcd8d

Please sign in to comment.