summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mitsuru Oshima <nobody@android.com> 2009-04-29 17:13:46 -0700
committer The Android Open Source Project <initial-contribution@android.com> 2009-04-29 17:13:46 -0700
commitdffbb4dbceb7e90e91b65d02dfdbd1abd6147b94 (patch)
tree05b21f8c0995a07e1a0e0c5f91395494a8fcc7eb
parent8169daed2f7a8731d478b884b1f455c747b88478 (diff)
AI 148024: fix NPE when there is no history
Automated import of CL 148024
-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 24026601145e..0d5567908af8 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;
+ }
}
}
}