diff --git a/commons/ihe/fhir/r4/audit/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti81/Iti81AuditStrategy.java b/commons/ihe/fhir/r4/audit/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti81/Iti81AuditStrategy.java index 9cb0705423..ea34050148 100644 --- a/commons/ihe/fhir/r4/audit/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti81/Iti81AuditStrategy.java +++ b/commons/ihe/fhir/r4/audit/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti81/Iti81AuditStrategy.java @@ -46,11 +46,13 @@ public AuditMessage[] makeAuditMessage(AuditContext auditContext, FhirAuditEvent @Override public boolean enrichAuditDatasetFromResponse(FhirAuditEventQueryAuditDataset auditDataset, Object response, AuditContext auditContext) { - var bundle = (Bundle) response; - bundle.getEntry().stream() - .filter(bundleEntryComponent -> bundleEntryComponent.getResource() instanceof AuditEvent) - .map(Bundle.BundleEntryComponent::getFullUrl) - .forEach(uri -> auditDataset.getAuditEventUris().add(uri)); + if (response instanceof Bundle) { + var bundle = (Bundle) response; + bundle.getEntry().stream() + .filter(bundleEntryComponent -> bundleEntryComponent.getResource() instanceof AuditEvent) + .map(Bundle.BundleEntryComponent::getFullUrl) + .forEach(uri -> auditDataset.getAuditEventUris().add(uri)); + } return super.enrichAuditDatasetFromResponse(auditDataset, response, auditContext); } }