Skip to content
Snippets Groups Projects
Commit 035f0f5c authored by Ken Wakasa's avatar Ken Wakasa
Browse files

Fix NPE

bug: 5054162
Change-Id: I69d308f0eeb32968515100dde98ad51a7c35020e
parent 8721398e
No related branches found
No related tags found
No related merge requests found
...@@ -136,6 +136,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { ...@@ -136,6 +136,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
@Override @Override
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
final KeyboardView keyboardView = getOuterInstance(); final KeyboardView keyboardView = getOuterInstance();
if (keyboardView == null) return;
final PointerTracker tracker = (PointerTracker) msg.obj; final PointerTracker tracker = (PointerTracker) msg.obj;
switch (msg.what) { switch (msg.what) {
case MSG_SHOW_KEY_PREVIEW: case MSG_SHOW_KEY_PREVIEW:
...@@ -150,8 +151,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { ...@@ -150,8 +151,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
} }
public void showKeyPreview(long delay, int keyIndex, PointerTracker tracker) { public void showKeyPreview(long delay, int keyIndex, PointerTracker tracker) {
final KeyboardView keyboardView = getOuterInstance();
removeMessages(MSG_SHOW_KEY_PREVIEW); removeMessages(MSG_SHOW_KEY_PREVIEW);
final KeyboardView keyboardView = getOuterInstance();
if (keyboardView == null) return;
if (keyboardView.mPreviewText.getVisibility() == VISIBLE || delay == 0) { if (keyboardView.mPreviewText.getVisibility() == VISIBLE || delay == 0) {
// Show right away, if it's already visible and finger is moving around // Show right away, if it's already visible and finger is moving around
keyboardView.showKey(keyIndex, tracker); keyboardView.showKey(keyIndex, tracker);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment