summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/jni/AndroidRuntime.cpp2
-rw-r--r--core/jni/android_view_MotionEvent.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 97f24355ea51..cd7452527a86 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -1088,7 +1088,7 @@ void AndroidRuntime::start(const char* className, const Vector<String8>& options
* Start VM. This thread becomes the main thread of the VM, and will
* not return until the VM exits.
*/
- char* slashClassName = toSlashClassName(className);
+ char* slashClassName = toSlashClassName(className != NULL ? className : "");
jclass startClass = env->FindClass(slashClassName);
if (startClass == NULL) {
ALOGE("JavaVM unable to locate class '%s'\n", slashClassName);
diff --git a/core/jni/android_view_MotionEvent.cpp b/core/jni/android_view_MotionEvent.cpp
index 2132f3d01786..a9efb009ba9d 100644
--- a/core/jni/android_view_MotionEvent.cpp
+++ b/core/jni/android_view_MotionEvent.cpp
@@ -345,8 +345,10 @@ static jlong android_view_MotionEvent_nativeInitialize(JNIEnv* env, jclass clazz
return 0;
}
- MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
- if (!event) {
+ MotionEvent* event;
+ if (nativePtr) {
+ event = reinterpret_cast<MotionEvent*>(nativePtr);
+ } else {
event = new MotionEvent();
}