Skip to content

Commit 1c9c92d

Browse files
committed
return when an error occurs
1 parent 618f8fd commit 1c9c92d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/lib/annotation_exporter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var annotations_exporter = function (pl) {
1717
var oldAnnotations = fs.readFileSync(path.resolve(paths.source.annotations, 'annotations.js'), 'utf8');
1818
} catch (ex) {
1919
console.log('annotations.js file missing from ' + paths.source.annotations + '. This may be expected.');
20+
return [];
2021
}
2122

2223
//parse as JSON by removing the old wrapping js syntax. comments and the trailing semi-colon
@@ -26,6 +27,7 @@ var annotations_exporter = function (pl) {
2627
} catch (ex) {
2728
console.log('There was an error parsing JSON for ' + paths.source.annotations + 'annotations.js');
2829
console.log(ex);
30+
return [];
2931
}
3032
return oldAnnotationsJSON.comments;
3133
}
@@ -42,6 +44,7 @@ var annotations_exporter = function (pl) {
4244
annotationsMD = fs.readFileSync(path.resolve(paths.source.annotations, 'annotations.md'), 'utf8');
4345
} catch (ex) {
4446
console.log('annotations.md file missing from ' + paths.source.annotations + '. This may be expected.');
47+
return [];
4548
}
4649

4750
//take the annotation snippets and split them on our custom delimiter

0 commit comments

Comments
 (0)