From ba4d93fcd76fdd7c8368e23c7faf9a20684e51a0 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Wed, 19 Aug 2009 18:27:56 -0700 Subject: Potential fix for NPE at startExtractingText. This is not easy to reproduce. Adding a simple null check to see if the monkeys continue to hit the NPE. --- core/java/android/inputmethodservice/InputMethodService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/java/android/inputmethodservice/InputMethodService.java') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 6ee92ce6b019..1f640ea12bb0 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -1992,8 +1992,9 @@ public class InputMethodService extends AbstractInputMethodService { req.flags = InputConnection.GET_TEXT_WITH_STYLES; req.hintMaxLines = 10; req.hintMaxChars = 10000; - mExtractedText = getCurrentInputConnection().getExtractedText(req, - InputConnection.GET_EXTRACTED_TEXT_MONITOR); + InputConnection ic = getCurrentInputConnection(); + mExtractedText = ic == null? null + : ic.getExtractedText(req, InputConnection.GET_EXTRACTED_TEXT_MONITOR); final EditorInfo ei = getCurrentInputEditorInfo(); -- cgit v1.2.3