diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/http/GatewayClientService.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/http/GatewayClientService.java index 05cb3679d..839f130b5 100644 --- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/http/GatewayClientService.java +++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/http/GatewayClientService.java @@ -33,6 +33,11 @@ public class GatewayClientService { * @return */ public DataResult getLoginQrCode() { + if (chat2dbProperties == null || chat2dbProperties.getGateway() == null + || chat2dbProperties.getGateway().getBaseUrl() == null) { + throw new IllegalStateException("Gateway base URL is not configured properly."); + } + DataResult result = Forest.get(chat2dbProperties.getGateway().getBaseUrl() + "/api/client/loginQrCode") .connectTimeout(Duration.ofMillis(5000)) .readTimeout(Duration.ofMillis(10000))