Skip to content

Commit

Permalink
[header] Don't assign preview when there is an error in yaml
Browse files Browse the repository at this point in the history
Fixes #693.
  • Loading branch information
saharj committed Dec 18, 2015
1 parent fa590f4 commit 6dfa6a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/scripts/controllers/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6dfa6a1

Please sign in to comment.