Check for null data before writing contact rows to server
Change-Id: Ib7016c43b2655e1753680c511f30cad8f4a1acce
This commit is contained in:
parent
be60dfdee7
commit
86ada729c2
@ -1556,6 +1556,7 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
|
|||||||
|
|
||||||
private void sendPhone(Serializer s, ContentValues cv) throws IOException {
|
private void sendPhone(Serializer s, ContentValues cv) throws IOException {
|
||||||
String value = cv.getAsString(Phone.NUMBER);
|
String value = cv.getAsString(Phone.NUMBER);
|
||||||
|
if (value == null) return;
|
||||||
switch (cv.getAsInteger(Phone.TYPE)) {
|
switch (cv.getAsInteger(Phone.TYPE)) {
|
||||||
case TYPE_WORK2:
|
case TYPE_WORK2:
|
||||||
s.data(Tags.CONTACTS_BUSINESS2_TELEPHONE_NUMBER, value);
|
s.data(Tags.CONTACTS_BUSINESS2_TELEPHONE_NUMBER, value);
|
||||||
@ -1600,6 +1601,7 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
|
|||||||
|
|
||||||
private void sendRelation(Serializer s, ContentValues cv) throws IOException {
|
private void sendRelation(Serializer s, ContentValues cv) throws IOException {
|
||||||
String value = cv.getAsString(Relation.DATA);
|
String value = cv.getAsString(Relation.DATA);
|
||||||
|
if (value == null) return;
|
||||||
switch (cv.getAsInteger(Relation.TYPE)) {
|
switch (cv.getAsInteger(Relation.TYPE)) {
|
||||||
case Relation.TYPE_ASSISTANT:
|
case Relation.TYPE_ASSISTANT:
|
||||||
s.data(Tags.CONTACTS_ASSISTANT_NAME, value);
|
s.data(Tags.CONTACTS_ASSISTANT_NAME, value);
|
||||||
|
Loading…
Reference in New Issue
Block a user