Skip to content

Commit 47ff2ef

Browse files
authored
Adds null check for foundGroups
Doing a `getGroups()` when there are no groups returned, the following null error occurs: ``` 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 'foundGroups.count') file:///app/tns_modules/nativescript-contacts/index.js:137:20 ``` Adding the null check prevents the error.
1 parent b23766b commit 47ff2ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ exports.getGroups = function(name) {
134134
reject(error.localizedDescription);
135135
}
136136

137-
if (foundGroups.count > 0) {
137+
if (foundGroups && foundGroups.count > 0) {
138138
var groups = [],
139139
i = 0,
140140
groupModel = null;

0 commit comments

Comments
 (0)