Added NPE gueard for TraceFeignContext
This commit is contained in:
@@ -32,6 +32,9 @@ class TraceFeignContext extends FeignContext {
|
|||||||
@Override
|
@Override
|
||||||
public <T> Map<String, T> getInstances(String name, Class<T> type) {
|
public <T> Map<String, T> getInstances(String name, Class<T> type) {
|
||||||
Map<String, T> instances = this.delegate.getInstances(name, type);
|
Map<String, T> instances = this.delegate.getInstances(name, type);
|
||||||
|
if (instances == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
Map<String, T> convertedInstances = new HashMap<>();
|
Map<String, T> convertedInstances = new HashMap<>();
|
||||||
for (Map.Entry<String, T> entry : instances.entrySet()) {
|
for (Map.Entry<String, T> entry : instances.entrySet()) {
|
||||||
convertedInstances.put(entry.getKey(), (T) this.traceFeignObjectWrapper.wrap(entry.getValue()));
|
convertedInstances.put(entry.getKey(), (T) this.traceFeignObjectWrapper.wrap(entry.getValue()));
|
||||||
|
|||||||
Reference in New Issue
Block a user