mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
Fixed empty Extra Variable JSON parsing issue
if the user saved a job template with empty extra variables and the Parse as option as JSON, then the UI crapped out. I added a check to make sure the default string is '{}' if the user submits an empty field.
This commit is contained in:
parent
3164c6d356
commit
c05d746d73
@ -87,6 +87,10 @@ angular.module('VariablesHelper', ['Utilities'])
|
||||
// lines, i, newVars = [];
|
||||
if (parseType === 'json') {
|
||||
try {
|
||||
// perform a check to see if the user cleared the field completly
|
||||
if(variables === "" ){
|
||||
variables = "{}";
|
||||
}
|
||||
//parse a JSON string
|
||||
if (reviver) {
|
||||
json_data = JSON.parse(variables, reviver);
|
||||
@ -103,7 +107,7 @@ angular.module('VariablesHelper', ['Utilities'])
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if(variables=== ""){
|
||||
if(variables === ""){
|
||||
variables = '---';
|
||||
}
|
||||
json_data = jsyaml.load(variables);
|
||||
|
Loading…
Reference in New Issue
Block a user