Prevent NPE if k8s Client returns null for metadata and/or annotations (#283)
Fixes #282
This commit is contained in:
committed by
Spencer Gibb
parent
c62e67f7ca
commit
70d164a193
@@ -135,6 +135,10 @@ public class KubernetesDiscoveryClient implements DiscoveryClient {
|
||||
// but with the keys prefixed
|
||||
// if the prefix is null or empty, the map itself is returned (unchanged of course)
|
||||
private Map<String, String> getMapWithPrefixedKeys(Map<String, String> map, String prefix) {
|
||||
if(map == null) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
// when the prefix is empty just return an map with the same entries
|
||||
if (!StringUtils.hasText(prefix)) {
|
||||
return map;
|
||||
|
||||
Reference in New Issue
Block a user