Skip to content
Snippets Groups Projects
  • Kurt Partridge's avatar
    a68cace7
    Avoid NPE by fixing ResearchLogger initialization · a68cace7
    Kurt Partridge authored
    Previously, mMainResearchLog and mMainLogBuffer were set up
    when the user moved to a new TextView, and set to null when
    the user left the TextView.  This change causes
    mMainResearchLog, mMainLogBuffer, mFeedbackLog, and
    mFeedbackLogBuffer to be non-null forever after init() is
    called.  start() no longer sets up these fields; instead
    they are cleared and reset every time stop() is called.
    Checks for null values are now removed.
    
    The earlier code just didn't initialize these variables if
    the user disabled logging, but since the new version
    invariantly keeps these variables valid, we add a check for
    whether the user has enabled logging in publishLogUnits().
    
    Change-Id: Ifde3517f1cf924cfa33cda95fec24529b52b3c08
    a68cace7
    History
    Avoid NPE by fixing ResearchLogger initialization
    Kurt Partridge authored
    Previously, mMainResearchLog and mMainLogBuffer were set up
    when the user moved to a new TextView, and set to null when
    the user left the TextView.  This change causes
    mMainResearchLog, mMainLogBuffer, mFeedbackLog, and
    mFeedbackLogBuffer to be non-null forever after init() is
    called.  start() no longer sets up these fields; instead
    they are cleared and reset every time stop() is called.
    Checks for null values are now removed.
    
    The earlier code just didn't initialize these variables if
    the user disabled logging, but since the new version
    invariantly keeps these variables valid, we add a check for
    whether the user has enabled logging in publishLogUnits().
    
    Change-Id: Ifde3517f1cf924cfa33cda95fec24529b52b3c08