Skip to content

Commit

Permalink
Merge pull request kubernetes#343 from ZP-AlwaysWin/dev01
Browse files Browse the repository at this point in the history
fix to prevent null pointer exceptions
  • Loading branch information
k8s-ci-robot authored Sep 19, 2019
2 parents f714111 + 2ef4b3a commit 7c24236
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public List<InetAddress> getSeeds() {
String namespace = getEnvOrDefault("POD_NAMESPACE", "default");

String initialSeeds = getEnvOrDefault("CASSANDRA_SEEDS", "");
if (initialSeeds.equals("")) {

if ("".equals(initialSeeds)) {
initialSeeds = getEnvOrDefault("POD_IP", "");
}

Expand All @@ -79,11 +80,11 @@ public List<InetAddress> getSeeds() {

try {
Endpoints endpoints = mapper.readValue(data, Endpoints.class);
logger.info("cassandra seeds: " + endpoints.ips.toString());
logger.info("cassandra seeds: {}", endpoints.ips.toString());
return Collections.unmodifiableList(endpoints.ips);
} catch (IOException e) {
// This should not happen
logger.error("unexpected error building cassandra seeds: " + e.getMessage());
logger.error("unexpected error building cassandra seeds: {}" , e.getMessage());
return Collections.emptyList();
}
}
Expand Down

0 comments on commit 7c24236

Please sign in to comment.