mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 02:01:01 -03:30
interpret empty codemirror json content as empty object
This commit is contained in:
@@ -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] = '---';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user