diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/GatewayService.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/GatewayService.java index a2c39eddc..79837d744 100644 --- a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/GatewayService.java +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/GatewayService.java @@ -289,8 +289,9 @@ public class GatewayService extends QueueConsumer implements InitializingBean { String clearingSystem = StringUtils.isNotEmpty(gatewayApiSettings.getClearingSystem()) ? gatewayApiSettings.getClearingSystem() : "SPVB"; request.setClearingSystem(clearingSystem); - if (inboundServerSettings.getAllowedTypes().isEmpty() || - inboundServerSettings.getAllowedTypes().contains(request.getType())) { + if (inboundServerSettings != null && + (inboundServerSettings.getAllowedTypes().isEmpty() || + inboundServerSettings.getAllowedTypes().contains(request.getType()))) { String url = formingInboundUrl(inboundServerSettings.getEnableSsl(), inboundServerSettings.getHost(), inboundServerSettings.getPort(), @@ -298,8 +299,9 @@ public class GatewayService extends QueueConsumer implements InitializingBean { exchange(request, url); } - if (inboundExternalServerSettings.getAllowedTypes().isEmpty() || - inboundExternalServerSettings.getAllowedTypes().contains(request.getType())) { + if (inboundExternalServerSettings != null && + (inboundExternalServerSettings.getAllowedTypes().isEmpty() || + inboundExternalServerSettings.getAllowedTypes().contains(request.getType()))) { String url = formingInboundUrl(inboundExternalServerSettings.getEnableSsl(), inboundExternalServerSettings.getHost(), inboundExternalServerSettings.getPort(), @@ -308,7 +310,7 @@ public class GatewayService extends QueueConsumer implements InitializingBean { } } - private void exchange(OutboundRequest request, String url){ + private void exchange(OutboundRequest request, String url) { HttpEntity r = makeDefaultRequest(request); ResponseEntity response = restTemplate.exchange(url, HttpMethod.POST, r, SuccessResponse.class); SuccessResponse bodyResponse = response.getBody();