kirm / sip.js

Session Initiation Protocol for node.js
MIT License
427 stars 171 forks source link

Deep copyMessage crashes #137

Closed SlugFiller closed 4 years ago

SlugFiller commented 5 years ago

If using copyMessage with deep=true, an error is thrown in most cases. The reason is in this line: if(typeof o === 'object') {

The issue is that typeof null === 'object'. The line needs to be changed to: if(typeof o === 'object' && o !== null) {

kirm commented 4 years ago

Fixed that, thanks!