diff --git a/lib/rest/rest-entity.js b/lib/rest/rest-entity.js index 90b61bd..11adfc0 100644 --- a/lib/rest/rest-entity.js +++ b/lib/rest/rest-entity.js @@ -34,7 +34,7 @@ class RestEntity { try { const res = await this.get(`Accounts/${this.accountSid}/${this.name}/${sid}`); //get call by sid will return call cdr as a object and not an array - return res ? res : null; + return res; } catch (err) { if (err.statusCode === 404) throw new Error(`${this.name}.retrieve: sid ${sid} not found`); if (err.statusCode !== 204) throw new Error(`${this.name}.retrieve: unexpected status code ${err.statusCode}`);