Skip to content
Snippets Groups Projects
  • Kurt Partridge's avatar
    7d72ca0b
    Avoid JsonWriter multi-write error · 7d72ca0b
    Kurt Partridge authored
    JsonWriter requires that its clients pass it only a single top-level object.
    The existing implementation tries to make code cleaner by having mJsonWriter
    never be null, and instead use a global static "NULL_JSON_WRITER" that just
    discards data.  But because JsonWriter complains if more than one top-level
    object is passed, making this a global object does not work.  This change
    instead copes with mJsonWriter being null.
    
    Change-Id: Ia37ccfc8646e91f11a64713dd92d2846eb86ac54
    7d72ca0b
    History
    Avoid JsonWriter multi-write error
    Kurt Partridge authored
    JsonWriter requires that its clients pass it only a single top-level object.
    The existing implementation tries to make code cleaner by having mJsonWriter
    never be null, and instead use a global static "NULL_JSON_WRITER" that just
    discards data.  But because JsonWriter complains if more than one top-level
    object is passed, making this a global object does not work.  This change
    instead copes with mJsonWriter being null.
    
    Change-Id: Ia37ccfc8646e91f11a64713dd92d2846eb86ac54