summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/MotionEvent.java
diff options
context:
space:
mode:
authorMitsuru Oshima <nobody@android.com>2009-04-29 17:13:46 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-29 17:13:46 -0700
commitdffbb4dbceb7e90e91b65d02dfdbd1abd6147b94 (patch)
tree05b21f8c0995a07e1a0e0c5f91395494a8fcc7eb /core/java/android/view/MotionEvent.java
parent8169daed2f7a8731d478b884b1f455c747b88478 (diff)
downloadframeworks_base-dffbb4dbceb7e90e91b65d02dfdbd1abd6147b94.zip
frameworks_base-dffbb4dbceb7e90e91b65d02dfdbd1abd6147b94.tar.gz
frameworks_base-dffbb4dbceb7e90e91b65d02dfdbd1abd6147b94.tar.bz2
AI 148024: fix NPE when there is no history
Automated import of CL 148024
Diffstat (limited to 'core/java/android/view/MotionEvent.java')
-rw-r--r--core/java/android/view/MotionEvent.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index 2402660..0d55679 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -225,10 +225,12 @@ public final class MotionEvent implements Parcelable {
mSize *= scale;
mXPrecision *= scale;
mYPrecision *= scale;
- float[] history = mHistory;
- int length = history.length;
- for (int i = 0; i < length; i++) {
- history[i] *= scale;
+ if (mHistory != null) {
+ float[] history = mHistory;
+ int length = history.length;
+ for (int i = 0; i < length; i++) {
+ history[i] *= scale;
+ }
}
}
}