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
This commit is contained in:
Marc Blank 2010-03-02 14:18:14 -08:00
parent 777dbe5999
commit 1e474a41ba

View File

@ -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);