Fix NPE when adding note rows to Contacts

Change-Id: I51574db9abc45b55f8a7c19d493fdc47bc24b11b
This commit is contained in:
Marc Blank 2009-09-13 12:04:59 -07:00
parent f50c6d1faf
commit c7897acf56

View File

@ -1334,9 +1334,8 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
public void addNote(Entity entity, String note) { public void addNote(Entity entity, String note) {
RowBuilder builder = typedRowBuilder(entity, Note.CONTENT_ITEM_TYPE, -1); RowBuilder builder = typedRowBuilder(entity, Note.CONTENT_ITEM_TYPE, -1);
ContentValues cv = builder.cv; ContentValues cv = builder.cv;
if (note != null) { if (note == null) return;
note = note.replaceAll("\r\n", "\n"); note = note.replaceAll("\r\n", "\n");
}
if (cv != null && cvCompareString(cv, Note.NOTE, note)) { if (cv != null && cvCompareString(cv, Note.NOTE, note)) {
return; return;
} }