Skip to content

Commit e4d41a1

Browse files
committed
fix(#367): skip invalid presets
1 parent f559881 commit e4d41a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ptz.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ module.exports = function(Cam) {
3232
presets = [presets];
3333
}
3434
presets.forEach(function(preset) {
35-
this.presets[preset.$.token] = preset;
35+
if (preset.$ && preset.$.token !== undefined ) {
36+
this.presets[preset.$.token] = preset;
37+
}
3638
}.bind(this));
3739
}
3840
}

0 commit comments

Comments
 (0)