From ec1897ac3e048ac16e67d32b7d5d56c7a3d3a54d Mon Sep 17 00:00:00 2001 From: mabashian Date: Fri, 13 Apr 2018 13:05:28 -0400 Subject: [PATCH] Check to make sure extraVarsClone exists before attempting to cull passwords --- .../templates/prompt/steps/preview/prompt-preview.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/templates/prompt/steps/preview/prompt-preview.controller.js b/awx/ui/client/src/templates/prompt/steps/preview/prompt-preview.controller.js index 8ba42991f5..2eeddc4883 100644 --- a/awx/ui/client/src/templates/prompt/steps/preview/prompt-preview.controller.js +++ b/awx/ui/client/src/templates/prompt/steps/preview/prompt-preview.controller.js @@ -82,7 +82,7 @@ export default // password $encrypted$ strings so we clone it const extraVarsClone = _.cloneDeep(scope.promptData.extraVars); // Replace the survey passwords with $encrypted$ to display to the user - const cleansedExtraVars = Object.assign(extraVarsClone, surveyPasswords); + const cleansedExtraVars = extraVarsClone ? Object.assign(extraVarsClone, surveyPasswords) : {}; scope.promptExtraVars = $.isEmptyObject(scope.promptData.extraVars) ? '---' : '---\n' + jsyaml.safeDump(cleansedExtraVars);