From 9a1a1830fc5e000cf8c8fc5a571f7da9a53c3829 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 26 May 2021 12:03:32 +0200 Subject: [PATCH] Fix type error --- www/form/inner.js | 6 +++--- www/form/main.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/form/inner.js b/www/form/inner.js index f37b3f3e4..bfc7dac3a 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -661,9 +661,6 @@ define([ framework.onReady(function (isNew) { var priv = metadataMgr.getPrivateData(); - var $container = $('#cp-app-form-container'); - $container.append(makeFormCreator()); - if (APP.isEditor) { if (!content.form) { content.form = {}; @@ -683,6 +680,9 @@ define([ } } + var $container = $('#cp-app-form-container'); + $container.append(makeFormCreator()); + if (!content.answers || !content.answers.channel || !content.answers.publicKey || !content.answers.validateKey) { return void UI.errorLoadingScreen(Messages.form_invalid); } diff --git a/www/form/main.js b/www/form/main.js index 4ebe99295..ca4aea7e6 100644 --- a/www/form/main.js +++ b/www/form/main.js @@ -21,7 +21,7 @@ define([ var keys = Utils.secret && Utils.secret.keys; var parsed = Utils.Hash.parseTypeHash('pad', hash.slice(1)); - if (parsed.auditorKey) { + if (parsed && parsed.auditorKey) { meta.form_auditorKey = parsed.auditorKey; meta.form_auditorHash = hash; }