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
diff --git a/src/com/android/exchange/adapter/Serializer.java b/src/com/android/exchange/adapter/Serializer.java
index 8cdb99b..bc8e9d7 100644
--- a/src/com/android/exchange/adapter/Serializer.java
+++ b/src/com/android/exchange/adapter/Serializer.java
@@ -146,6 +146,9 @@
}
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 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);