diff --git a/awx/ui/client/src/notifications/add/add.controller.js b/awx/ui/client/src/notifications/add/add.controller.js index 0be8962b3f..d2dbf279f2 100644 --- a/awx/ui/client/src/notifications/add/add.controller.js +++ b/awx/ui/client/src/notifications/add/add.controller.js @@ -105,7 +105,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject', $scope.$watch('headers', function validate_headers(str) { try { - let headers = JSON.parse(str); + const headers = typeof str === 'string' ? JSON.parse(str) : str; if (_.isObject(headers) && !_.isArray(headers)) { let valid = true; for (let k in headers) { diff --git a/awx/ui/client/src/notifications/edit/edit.controller.js b/awx/ui/client/src/notifications/edit/edit.controller.js index a78b4c9c78..afafd35958 100644 --- a/awx/ui/client/src/notifications/edit/edit.controller.js +++ b/awx/ui/client/src/notifications/edit/edit.controller.js @@ -189,7 +189,7 @@ export default ['Rest', 'Wait', $scope.$watch('headers', function validate_headers(str) { try { - let headers = JSON.parse(str); + const headers = typeof str === 'string' ? JSON.parse(str) : str; if (_.isObject(headers) && !_.isArray(headers)) { let valid = true; for (let k in headers) {