From c7897acf56251d3ea4c484616643c22fe76c2646 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sun, 13 Sep 2009 12:04:59 -0700 Subject: [PATCH] Fix NPE when adding note rows to Contacts Change-Id: I51574db9abc45b55f8a7c19d493fdc47bc24b11b --- src/com/android/exchange/adapter/ContactsSyncAdapter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/com/android/exchange/adapter/ContactsSyncAdapter.java b/src/com/android/exchange/adapter/ContactsSyncAdapter.java index 763dbd9ba..919e6df60 100644 --- a/src/com/android/exchange/adapter/ContactsSyncAdapter.java +++ b/src/com/android/exchange/adapter/ContactsSyncAdapter.java @@ -1334,9 +1334,8 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter { public void addNote(Entity entity, String note) { RowBuilder builder = typedRowBuilder(entity, Note.CONTENT_ITEM_TYPE, -1); ContentValues cv = builder.cv; - if (note != null) { - note = note.replaceAll("\r\n", "\n"); - } + if (note == null) return; + note = note.replaceAll("\r\n", "\n"); if (cv != null && cvCompareString(cv, Note.NOTE, note)) { return; }