Skip to content

Commit c901a28

Browse files
authored
Merge pull request #292 from ChanakaWeerasinghe/patch-1
java.lang.NullPointerException
2 parents 879e0fa + 7f7516f commit c901a28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

android/src/main/java/flutter/plugins/contactsservice/contactsservice/ContactsServicePlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,15 @@ public boolean onActivityResult(int requestCode, int resultCode, Intent intent)
287287
return true;
288288
}
289289
Uri contactUri = intent.getData();
290+
if (intent != null){
290291
Cursor cursor = contentResolver.query(contactUri, null, null, null, null);
291292
if (cursor.moveToFirst()) {
292293
String id = contactUri.getLastPathSegment();
293294
getContacts("openDeviceContactPicker", id, false, false, false, localizedLabels, this.result);
294295
} else {
295296
Log.e(LOG_TAG, "onActivityResult - cursor.moveToFirst() returns false");
296297
finishWithResult(FORM_OPERATION_CANCELED);
297-
}
298+
}}else{return true;}
298299
cursor.close();
299300
return true;
300301
}

0 commit comments

Comments
 (0)