This is an automated email from the ASF dual-hosted git repository.
dengliming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 2f8066b14b fix: filter out the null URIRegisterDTO (#7068)
2f8066b14b is described below
commit 2f8066b14be5124940826bb81c1934bc4155cfc7
Author: hengyuss <[email protected]>
AuthorDate: Wed Sep 16 22:28:44 2026 +0800
fix: filter out the null URIRegisterDTO (#7068)
---
.../client/core/client/AbstractContextRefreshedEventListener.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/client/AbstractContextRefreshedEventListener.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/client/AbstractContextRefreshedEventListener.java
index e329ef09b5..96e523cc72 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/client/AbstractContextRefreshedEventListener.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/client/AbstractContextRefreshedEventListener.java
@@ -154,7 +154,12 @@ public abstract class
AbstractContextRefreshedEventListener<T, A extends Annotat
boolean isDiscoveryLocalMode =
ShenyuClientConstants.DISCOVERY_LOCAL_MODE.equals(discoveryMode);
if (isDiscoveryLocalMode) {
List<String> namespaceIds = this.getNamespace();
- namespaceIds.forEach(namespaceId ->
publisher.publishEvent(buildURIRegisterDTO(context, beans, namespaceId)));
+ namespaceIds.forEach(namespaceId -> {
+ URIRegisterDTO uriRegisterDTO = buildURIRegisterDTO(context,
beans, namespaceId);
+ if (Objects.nonNull(uriRegisterDTO)) {
+ publisher.publishEvent(uriRegisterDTO);
+ }
+ });
}
beans.forEach(this::handle);
Map<String, Object> apiModules =
context.getBeansWithAnnotation(ApiModule.class);