提交 d2f32587 编写于 作者: J Jason Song

fix coverity defect

上级 4e129e70
......@@ -46,7 +46,7 @@ public class ApolloDataSourceProvider implements DataSourceProvider, LogEnabled
String appId = Foundation.app().getAppId();
String envType = Foundation.server().getEnvType();
if (file.hasContent()) {
if (file != null && file.hasContent()) {
String content = file.getContent();
m_logger.info(String.format("Found datasources.xml from Apollo(env=%s, app.id=%s)!", envType, appId));
......
......@@ -12,7 +12,7 @@ public abstract class PlainTextConfigFile extends AbstractConfigFile {
@Override
public String getContent() {
if (m_configProperties.get() == null) {
if (!this.hasContent()) {
return null;
}
return m_configProperties.get().getProperty(ConfigConsts.CONFIG_FILE_CONTENT_KEY);
......
......@@ -34,7 +34,7 @@ public class PropertiesConfigFile extends AbstractConfigFile {
}
String doGetContent() {
if (m_configProperties.get() == null) {
if (!this.hasContent()) {
return null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册