Skip to content

Commit

Permalink
Merge pull request #20 from seudut/master
Browse files Browse the repository at this point in the history
Fix error 'Failed to initialize the device: TypeError: profiles.forEa…
  • Loading branch information
futomi authored Feb 11, 2018
2 parents b7eb072 + 624e3b9 commit dd722a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/modules/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ OnvifDevice.prototype._mediaGetProfiles = function() {
reject(new Error('Failed to initialize the device: The targeted device does not any media profiles.'));
return;
}
profiles = [].concat(profiles) // in case profiles is not a list, then forEach below will report an error
profiles.forEach((p) => {
let profile = {
'token': p['$']['token'],
Expand Down Expand Up @@ -646,4 +647,4 @@ OnvifDevice.prototype._mediaGetSnapshotUri = function() {
return promise;
};

module.exports = OnvifDevice;
module.exports = OnvifDevice;

0 comments on commit dd722a6

Please sign in to comment.