Skip to content

Commit

Permalink
bugfix: add verification for item.request.metadata (#238)
Browse files Browse the repository at this point in the history
Co-authored-by: jtsai.dev <jtsai.dev@gmail.com>
  • Loading branch information
jtsai-dev and jtsai.dev authored Apr 17, 2023
1 parent d5f017e commit a628bc6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/resources/webform/webform.js
Original file line number Diff line number Diff line change
Expand Up @@ -2752,8 +2752,12 @@ window.initGRPCForm = function(services, svcDescs, mtdDescs, invokeURI, metadata
validateJSON();
// remove all rows
$("tr").remove('.metadataRow');
for (let metadata of item.request.metadata) {
addMetadataRow(metadata.name, metadata.value);
// item.request.metadata will be undefined when using -examples
// and without setting in json file, here it needs to be verified
if (item.request.metadata) {
for (let metadata of item.request.metadata) {
addMetadataRow(metadata.name, metadata.value);
}
}
});
});
Expand Down

0 comments on commit a628bc6

Please sign in to comment.