From 1e474a41ba33e06d49a7a853b7f25ca49591d955 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Tue, 2 Mar 2010 14:18:14 -0800 Subject: [PATCH] Add logging when an NPE is imminent when writing WBXML data * We want an NPE to be thrown, since we need to locate/fix errors of this kind. * Add logging to help isolate the error Change-Id: I0f4336b42cbdb88c72459bdeca9c9fc236d9299f --- src/com/android/exchange/adapter/Serializer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/exchange/adapter/Serializer.java b/src/com/android/exchange/adapter/Serializer.java index 8cdb99bad..bc8e9d7ff 100644 --- a/src/com/android/exchange/adapter/Serializer.java +++ b/src/com/android/exchange/adapter/Serializer.java @@ -146,6 +146,9 @@ public class Serializer { } public Serializer data(int tag, String value) throws IOException { + if (value == null) { + Log.e(TAG, "Writing null data for tag: " + tag); + } start(tag); text(value); end(); @@ -162,6 +165,9 @@ public class Serializer { } public Serializer text(String text) throws IOException { + if (text == null) { + Log.e(TAG, "Writing null text for pending tag: " + pendingTag); + } checkPendingTag(false); buf.write(Wbxml.STR_I); writeLiteralString(buf, text);