Fix NPE in KeyDetector

This is actually a follow up of I9290974821.

Bug: 13215075
Change-Id: Ib7eef55fd1cfbb05d06aeeb0726bc10c87b07d85
main
Tadashi G. Takaoka 2014-02-27 14:14:52 +09:00
parent 997ba1b41e
commit f8a45cfd2f
1 changed files with 3 additions and 0 deletions

View File

@ -86,6 +86,9 @@ public class KeyDetector {
* @return the key that the touch point hits. * @return the key that the touch point hits.
*/ */
public Key detectHitKey(final int x, final int y) { public Key detectHitKey(final int x, final int y) {
if (mKeyboard == null) {
return null;
}
final int touchX = getTouchX(x); final int touchX = getTouchX(x);
final int touchY = getTouchY(y); final int touchY = getTouchY(y);