Permalink
Browse files

Fix error catching -- don't call callback twice

  • Loading branch information...
1 parent b1f0bb2 commit c45ee95864f2e44ed3b39850f53a24d9d0d66d76 Mostafa Eweda committed Feb 7, 2013
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/generator.js
View
@@ -23,11 +23,10 @@ Generator.render = function(options, jadeCompileFn, filepath, filename, srcConte
}
}
- if (!found) {
- callback("ERROR: In " + filename + ", I could not find an H1 tag. We need this to generate the page's title.");
- }
+ if (!found)
+ return callback("ERROR: In " + filename + ", I could not find an H1 tag. We need this to generate the page's title.");
- // remove h1 now
+ // remove h1 now
if (!options.keepFirstHeader) {
replacedContent = replacedContent.replace(found.text, "");
}

0 comments on commit c45ee95

Please sign in to comment.