null check added

This commit is contained in:
Melih Aydogdu 2024-05-27 15:00:08 +02:00
parent f6e84ea801
commit f9a522e158
1 changed files with 6 additions and 2 deletions

View File

@ -600,8 +600,12 @@ public class GenericClient extends BaseClient implements IGenericClient {
if (resp instanceof IBaseBundle) { if (resp instanceof IBaseBundle) {
List<SearchBundleEntryParts> searchBundleEntryParts = List<SearchBundleEntryParts> searchBundleEntryParts =
BundleUtil.getSearchBundleEntryParts(getFhirContext(), (IBaseBundle) resp); BundleUtil.getSearchBundleEntryParts(getFhirContext(), (IBaseBundle) resp);
searchBundleEntryParts.forEach(searchBundleEntryPart -> ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.put( searchBundleEntryParts.forEach(searchBundleEntryPart -> {
searchBundleEntryPart.getResource(), searchBundleEntryPart.getSearchMode())); IBaseResource resource = searchBundleEntryPart.getResource();
if (resource != null) {
ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.put(resource, searchBundleEntryPart.getSearchMode());
}
});
} }
return resp; return resp;
} }