Skip to content

Commit

Permalink
Merge pull request #34 from openintegrationhub/metadata-fix
Browse files Browse the repository at this point in the history
Fixed a bug where undefined metadata would cause a crash
  • Loading branch information
SvenHoeffler authored Apr 17, 2024
2 parents b467b09 + 199f78a commit 7fa1646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/lib/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function getMetadata(metadata) {
const metadataKeys = ["oihUid", "recordUid", "applicationUid"];
let newMetadata = {};
for (let i = 0; i < metadataKeys.length; i++) {
if (metadataKeys[i] in metadata && metadata[metadataKeys[i]])
if (metadata && metadataKeys[i] in metadata && metadata[metadataKeys[i]])
newMetadata[metadataKeys[i]] = metadata[metadataKeys[i]];
}
return newMetadata;
Expand Down

0 comments on commit 7fa1646

Please sign in to comment.