ocilo / skype-http

Unofficial Skype API for Node.js via HTTP
https://ocilo.github.io/skype-http
MIT License
51 stars 24 forks source link

Error thrown on getContacts #41

Closed kfatehi closed 7 years ago

kfatehi commented 7 years ago

I get the following error when invoking api.getContacts()

TypeError: Cannot read property 'first' of undefined
    at contactToPerson (/home/keyvan/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/utils/formatters.js:114:68)
    at formatContact (/home/keyvan/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/utils/formatters.js:43:12)
    at arrayMap (/home/keyvan/matrix-puppet-skype/node_modules/lodash/lodash.js:660:23)
    at Function.map (/home/keyvan/matrix-puppet-skype/node_modules/lodash/lodash.js:9571:14)
    at Object.<anonymous> (/home/keyvan/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/api/get-contacts.js:29:18)
    at Generator.next (<anonymous>)
    at fulfilled (/home/keyvan/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/api/get-contacts.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:109:7)
mitchcapper commented 7 years ago

I believe this is fixed is master, if you are able to use the GitHub version you should be fine otherwise I would assume there will be another publish to npm in the next few weeks. Final option if you could manually edit your formatters.js and just do a check like (taken from current verison): const firstName: string | null = (native.name && native.name.first !== undefined) ? sanitizeXml(native.name.first) : null;

kfatehi commented 7 years ago

Yep it seems to be working in master

demurgos commented 7 years ago

I'll take some time this week-end to submit the current version to npm.