Merge pull request #1365 from mabashian/1346-empty-codemirror

Fixed empty codemirror bug
This commit is contained in:
Michael Abashian 2018-04-16 12:06:05 -04:00 committed by GitHub
commit 7cd26451b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);