From 0b70a90e1f54ae3a0c440a3a69b54b9b2f16f7ee Mon Sep 17 00:00:00 2001 From: Carlos Vializ Date: Mon, 1 May 2017 16:40:42 -0700 Subject: [PATCH] Check config is defined --- extensions/amp-form/0.1/form-verifiers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/amp-form/0.1/form-verifiers.js b/extensions/amp-form/0.1/form-verifiers.js index 23d59da691cc1..bc4f4e38efd43 100644 --- a/extensions/amp-form/0.1/form-verifiers.js +++ b/extensions/amp-form/0.1/form-verifiers.js @@ -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`); }