Skip to content

Commit 8bd772b

Browse files
authored
Merge pull request #94 from the-commons-project/handle-missing-resource-in-bundle-entry-array
IPS with only fullUrl in entry array item
2 parents 0e39028 + c50be0a commit 8bd772b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib/resources.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,15 @@ export function organizeResources(bundle, labelCounters) {
6060

6161
if (bundle.contentOK() && bundle.fhir.entry) {
6262
for (const i in bundle.fhir.entry) {
63-
63+
6464
const e = bundle.fhir.entry[i];
65-
const r = e.resource;
6665

66+
if (!e.resource) {
67+
console.error("Malformed bundle entry: " + JSON.stringify(e, null, 2));
68+
continue;
69+
}
70+
71+
const r = e.resource;
6772
organized.all.push(r);
6873

6974
organized.byId[e.fullUrl] = r;

0 commit comments

Comments
 (0)