Skip to content

Commit

Permalink
Check config is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Vializ committed May 1, 2017
1 parent e300e86 commit 0b70a90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/amp-form/0.1/form-verifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function parseConfig_(script) {
throw new Error('Failed to parse amp-form config. Is it valid JSON?');
});
const config = json && json[CONFIG_KEY];
if (!config.length) {
if (!config || !config.length) {
throw new Error(`The amp-form verification config should contain an array
property ${CONFIG_KEY} with at least one element`);
}
Expand Down

0 comments on commit 0b70a90

Please sign in to comment.