Skip to content

Commit

Permalink
checking to ensure the response location is there
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaban committed Nov 19, 2021
1 parent 8f41e7c commit 76efe76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/lib/routes/fhir.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ function saveResource(req, res) {
let filteredResponseBundle = [];
for(let entry of responseBundle.entry) {
let exists = filteredResponseBundle.findIndex((fil) => {
return fil.response.location.startsWith(entry.response.location.split('/_history')[0]);
return fil.response && entry.response && entry.response.location && fil.response.location.startsWith(entry.response.location.split('/_history')[0]);
});
if(exists === -1) {
filteredResponseBundle.push(entry);
Expand Down

0 comments on commit 76efe76

Please sign in to comment.