Skip to content

Commit

Permalink
Merge pull request #208 from slongiaru-rblab/patch-3
Browse files Browse the repository at this point in the history
Patch 3
  • Loading branch information
hawkeye64 authored Apr 15, 2020
2 parents b51ef8a + 5e28972 commit 647ac56
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class Camera {
return new Promise((resolve, reject) => {
this.core.getScopes()
.then(results => {
const scopes = results.data.GetScopesResponse.Scopes
const scopes = typeof results.data.GetScopesResponse.Scopes === 'undefined' || !Array.isArray(results.data.GetScopesResponse.Scopes) ? [] : results.data.GetScopesResponse.Scopes
this.deviceInformation.Ptz = false
scopes.forEach((scope) => {
const s = scope.ScopeItem
Expand Down Expand Up @@ -547,6 +547,11 @@ class Camera {
parseProfiles (profiles) {
const profileList = []

// When a single profile is given 'profiles' is the single profile
if (!Array.isArray(profiles)) {
profiles = [profiles]
}

profiles.forEach((profile) => {
profileList.push(profile)
if (!this.defaultProfile) {
Expand Down

0 comments on commit 647ac56

Please sign in to comment.