Fixes possible NPE

Fixes gh-719
This commit is contained in:
spencergibb
2021-07-01 17:11:43 -04:00
parent fe4eaf8e01
commit 5cd61ad974

View File

@@ -62,6 +62,7 @@ public class ConsulServiceInstance extends DefaultServiceInstance {
private static boolean getSecure(HealthService healthService) {
boolean secure = false;
Map<String, String> metadata = getMetadata(healthService);
// getMetadata() above returns an empty Map if meta is null
if (metadata.containsKey("secure")) {
secure = Boolean.parseBoolean(metadata.get("secure"));
}