Fix crash when sync() is called with no annotations

This function has no tests and I don't know what it does but sometimes
`undefined` is passed to it as the `annotations` arg and it crashes, so
fix that.
parent 5222458b
......@@ -61,10 +61,8 @@ AnnotationSync.prototype.sync = function(annotations) {
return function(err, annotations) {
var i;
var parsedAnnotations = [];
annotations = annotations || [];
if (annotations === null) {
annotations = [];
}
for (i = 0; i < annotations.length; i++) {
parsedAnnotations.push(_this._parse(annotations[i]));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment