Merge "Add logging when an NPE is imminent when writing WBXML data"

This commit is contained in:
Marc Blank 2010-03-02 14:23:11 -08:00 committed by Android (Google) Code Review
commit d05cc9196a

View File

@ -146,6 +146,9 @@ public class Serializer {
} }
public Serializer data(int tag, String value) throws IOException { public Serializer data(int tag, String value) throws IOException {
if (value == null) {
Log.e(TAG, "Writing null data for tag: " + tag);
}
start(tag); start(tag);
text(value); text(value);
end(); end();
@ -162,6 +165,9 @@ public class Serializer {
} }
public Serializer text(String text) throws IOException { public Serializer text(String text) throws IOException {
if (text == null) {
Log.e(TAG, "Writing null text for pending tag: " + pendingTag);
}
checkPendingTag(false); checkPendingTag(false);
buf.write(Wbxml.STR_I); buf.write(Wbxml.STR_I);
writeLiteralString(buf, text); writeLiteralString(buf, text);