Skip to content

Commit 37788d8

Browse files
authored
Merge pull request apolloconfig#595 from nobodyiam/fix-coverity-bug
fix coverity bugs
2 parents b928d82 + 996fc51 commit 37788d8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

apollo-core/src/main/java/com/ctrip/framework/foundation/internals/NetworkInterfaceManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.net.UnknownHostException;
88
import java.util.ArrayList;
99
import java.util.Collections;
10+
import java.util.Enumeration;
1011
import java.util.List;
1112
import java.util.Objects;
1213

@@ -96,7 +97,9 @@ private void load() {
9697
}
9798

9899
try {
99-
List<NetworkInterface> nis = Collections.list(NetworkInterface.getNetworkInterfaces());
100+
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
101+
List<NetworkInterface> nis = interfaces == null ? Collections.<NetworkInterface>emptyList()
102+
: Collections.list(NetworkInterface.getNetworkInterfaces());
100103
List<InetAddress> addresses = new ArrayList<InetAddress>();
101104
InetAddress local = null;
102105

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/ctrip/WebContextConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public ServletContextInitializer servletContextInitializer() {
3333
@Override
3434
public void onStartup(ServletContext servletContext) throws ServletException {
3535
String loggingServerIP = portalConfig.cloggingUrl();
36-
String loggingServerPort = portalConfig.cloggingUrl();
36+
String loggingServerPort = portalConfig.cloggingPort();
3737
String credisServiceUrl = portalConfig.credisServiceUrl();
3838

3939
servletContext.setInitParameter("loggingServerIP",

0 commit comments

Comments
 (0)