Skip to content

fix:fix NPE when using getConfigItem. #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public MetadataInfo getAppMetadata(SubscriberMetadataIdentifier identifier, Map<
Optional<ServiceContractProto.ServiceContract> result = getServiceContract(request);
if (!result.isPresent()) {
// 降级,由兜底的 MetadataReport 进行处理
return another.map(proxyReport -> proxyReport.getMetadataReport().getAppMetadata(identifier, instanceMetadata)).orElse(MetadataInfo.EMPTY);
return another.map(proxyReport -> proxyReport.getMetadataReport().getAppMetadata(identifier, instanceMetadata)).orElse(null);
}

Map<String, MetadataInfo.ServiceInfo> serviceInfos = new HashMap<>();
Expand Down Expand Up @@ -397,7 +397,7 @@ public void run() {
// -------- 仅用于 multi-metadata-report 情况下使用
@Override
public ConfigItem getConfigItem(String key, String group) {
return another.map(proxyReport -> proxyReport.getConfigItem(key, group)).orElse(null);
return another.map(proxyReport -> proxyReport.getConfigItem(key, group)).orElse(new ConfigItem());
}

@Override
Expand Down