diff --git a/app/scripts/controllers/header.js b/app/scripts/controllers/header.js index af588dfd703..7fd4fe4f8df 100644 --- a/app/scripts/controllers/header.js +++ b/app/scripts/controllers/header.js @@ -163,6 +163,11 @@ SwaggerEditor.controller('HeaderCtrl', function HeaderCtrl($scope, $modal, var yaml = $rootScope.editorValue; YAML.load(yaml, function (error, json) { + // Don't assign if there is an error + if (error) { + return; + } + // if `yaml` is JSON, convert it to YAML var jsonParseError = null; try {