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:
parent
777dbe5999
commit
1e474a41ba
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user