Skip to content

Commit 1a67f9b

Browse files
committed
properly return undefined instaed of [undefined] with empty results
1 parent c9f2e47 commit 1a67f9b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Application.prototype.getSipPeers = function(query, callback){
105105
return callback(err);
106106
}
107107
let sipPeers = res.associatedSipPeers.associatedSipPeer;
108-
if(!Array.isArray(sipPeers)){
108+
if(!Array.isArray(sipPeers) && sipPeers){
109109
sipPeers = [sipPeers];
110110
}
111111
callback(null,sipPeers);

lib/sipPeer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ SipPeer.prototype.listApplications = function(callback) {
8686
}
8787
else {
8888
var apps = results.applicationSettings;
89-
if (!Array.isArray(apps.httpMessagingV2AppId)) {
89+
if (!Array.isArray(apps.httpMessagingV2AppId) && apps.httpMessagingV2AppId) {
9090
apps.httpMessagingV2AppId = [apps.httpMessagingV2AppId]
9191
}
9292
callback(null, apps)

0 commit comments

Comments
 (0)