firescript / nativescript-contacts

A nativescript module that gives access to the native contact directory.
MIT License
28 stars 32 forks source link

getContactsInGroup() error if group has no contacts #55

Closed jzgoda closed 5 years ago

jzgoda commented 5 years ago

If you getContactsInGroup() with a group that has no contacts, the following error is thrown:

CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:15769:28: ERROR Error: Uncaught (in promise): TypeError: null is not an object (evaluating 'foundContacts.count')
file:///app/tns_modules/nativescript-contacts/index.js:198:26

It's caused by a missing null check in the following line: https://github.com/firescript/nativescript-contacts/blob/a9a9d50f4c8a8ae6cdfe08f63c66f6b354f8ca1e/index.ios.js#L213

I'll issue a PR for this.