Skip to content

Commit

Permalink
fix bug about nacos (apache#4308)
Browse files Browse the repository at this point in the history
* fix bug
* add trim
  • Loading branch information
IanCao authored and rolandhe committed Sep 9, 2019
1 parent 634309e commit 762b61f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.naming.NamingService;
import com.alibaba.nacos.client.naming.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

private void putPropertyIfAbsent(URL url, Properties properties, String propertyName) {
String propertyValue = url.getParameter(propertyName);
if (StringUtils.isNotEmpty(propertyValue)) {
if (propertyValue != null && propertyValue.trim().length() != 0) {
properties.setProperty(propertyName, propertyValue);
}
}
Expand Down

0 comments on commit 762b61f

Please sign in to comment.