Skip to content

Commit 024651d

Browse files
IanCaoralf0131
authored andcommitted
fix bug about nacos (apache#4308)
* fix bug * add trim
1 parent 52bef81 commit 024651d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.alibaba.nacos.api.NacosFactory;
2525
import com.alibaba.nacos.api.exception.NacosException;
2626
import com.alibaba.nacos.api.naming.NamingService;
27-
import com.alibaba.nacos.client.naming.utils.StringUtils;
2827
import org.slf4j.Logger;
2928
import org.slf4j.LoggerFactory;
3029

@@ -101,7 +100,7 @@ private void setProperties(URL url, Properties properties) {
101100

102101
private void putPropertyIfAbsent(URL url, Properties properties, String propertyName) {
103102
String propertyValue = url.getParameter(propertyName);
104-
if (StringUtils.isNotEmpty(propertyValue)) {
103+
if (propertyValue != null && propertyValue.trim().length() != 0) {
105104
properties.setProperty(propertyName, propertyValue);
106105
}
107106
}

0 commit comments

Comments
 (0)