mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 11:27:36 -02:30
interpret empty codemirror json content as empty object
This commit is contained in:
@@ -94,8 +94,12 @@ export default
|
|||||||
// convert json to yaml
|
// convert json to yaml
|
||||||
try {
|
try {
|
||||||
removeField(fld);
|
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)) {
|
if ($.isEmptyObject(json_obj)) {
|
||||||
scope[fld] = '---';
|
scope[fld] = '---';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user