diff --git a/awx/ui/client/src/shared/parse/parse-type-change.factory.js b/awx/ui/client/src/shared/parse/parse-type-change.factory.js index 218dfbbe9a..2373a06a46 100644 --- a/awx/ui/client/src/shared/parse/parse-type-change.factory.js +++ b/awx/ui/client/src/shared/parse/parse-type-change.factory.js @@ -94,8 +94,12 @@ export default // convert json to yaml try { removeField(fld); + let jsonString = scope[fld]; + if (jsonString.trim() === '') { + jsonString = '{}'; + } - json_obj = JSON.parse(scope[fld]); + json_obj = JSON.parse(jsonString); if ($.isEmptyObject(json_obj)) { scope[fld] = '---'; }