You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Class:io.fabric8.kubernetes.client.informers.cache.Cache
In method "replace" , if arg "list" is empty; this.indices will be set to an empty hashmap. in method "byIndex",object "index" used without check NPE, so when watch a kind without any resource, and then using byIndex to get, NPE happened. maybe should return an empty object instead of throw NPE.
// In byIndex Map<String, Set> index = this.indices.get(indexName);
Set set = index.get(indexKey);
public synchronized void replace(List list, String resourceVersion) {
Map<String, T> newItems = new HashMap<>();
for (T item : list) {
String key = keyFunc.apply(item);
newItems.put(key, item);
}
this.items = newItems;
// rebuild any index
**this.indices = new HashMap<>();**
for (Map.Entry<String, T> itemEntry : items.entrySet()) {
this.updateIndices(null, itemEntry.getValue(), itemEntry.getKey());
}
}
The text was updated successfully, but these errors were encountered:
In Class:io.fabric8.kubernetes.client.informers.cache.Cache
In method "replace" , if arg "list" is empty; this.indices will be set to an empty hashmap. in method "byIndex",object "index" used without check NPE, so when watch a kind without any resource, and then using byIndex to get, NPE happened. maybe should return an empty object instead of throw NPE.
// In byIndex
Map<String, Set> index = this.indices.get(indexName);
Set set = index.get(indexKey);
public synchronized void replace(List list, String resourceVersion) {
Map<String, T> newItems = new HashMap<>();
for (T item : list) {
String key = keyFunc.apply(item);
newItems.put(key, item);
}
this.items = newItems;
}
The text was updated successfully, but these errors were encountered: