am aa9db1e2: Merge "[Rlog] Fix some potential NPEs"
* commit 'aa9db1e2598e6a8c64844db4261e067e592a6f38': [Rlog] Fix some potential NPEsmain
commit
9f962af541
|
@ -1202,7 +1202,12 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
public static void latinIME_swapSwapperAndSpace(final CharSequence originalCharacters,
|
public static void latinIME_swapSwapperAndSpace(final CharSequence originalCharacters,
|
||||||
final String charactersAfterSwap) {
|
final String charactersAfterSwap) {
|
||||||
final ResearchLogger researchLogger = getInstance();
|
final ResearchLogger researchLogger = getInstance();
|
||||||
final LogUnit logUnit = researchLogger.mMainLogBuffer.peekLastLogUnit();
|
final LogUnit logUnit;
|
||||||
|
if (researchLogger.mMainLogBuffer == null) {
|
||||||
|
logUnit = null;
|
||||||
|
} else {
|
||||||
|
logUnit = researchLogger.mMainLogBuffer.peekLastLogUnit();
|
||||||
|
}
|
||||||
if (logUnit != null) {
|
if (logUnit != null) {
|
||||||
researchLogger.enqueueEvent(logUnit, LOGSTATEMENT_LATINIME_SWAPSWAPPERANDSPACE,
|
researchLogger.enqueueEvent(logUnit, LOGSTATEMENT_LATINIME_SWAPSWAPPERANDSPACE,
|
||||||
originalCharacters, charactersAfterSwap);
|
originalCharacters, charactersAfterSwap);
|
||||||
|
@ -1273,7 +1278,12 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
final String originallyTypedWord, final boolean isBatchMode) {
|
final String originallyTypedWord, final boolean isBatchMode) {
|
||||||
final ResearchLogger researchLogger = getInstance();
|
final ResearchLogger researchLogger = getInstance();
|
||||||
// TODO: Verify that mCurrentLogUnit has been restored and contains the reverted word.
|
// TODO: Verify that mCurrentLogUnit has been restored and contains the reverted word.
|
||||||
final LogUnit logUnit = researchLogger.mMainLogBuffer.peekLastLogUnit();
|
final LogUnit logUnit;
|
||||||
|
if (researchLogger.mMainLogBuffer == null) {
|
||||||
|
logUnit = null;
|
||||||
|
} else {
|
||||||
|
logUnit = researchLogger.mMainLogBuffer.peekLastLogUnit();
|
||||||
|
}
|
||||||
if (originallyTypedWord.length() > 0 && hasLetters(originallyTypedWord)) {
|
if (originallyTypedWord.length() > 0 && hasLetters(originallyTypedWord)) {
|
||||||
if (logUnit != null) {
|
if (logUnit != null) {
|
||||||
logUnit.setWord(originallyTypedWord);
|
logUnit.setWord(originallyTypedWord);
|
||||||
|
|
Loading…
Reference in New Issue