diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index bb815fefd..0b5344178 100644 --- a/android/cpp/jni.cpp +++ b/android/cpp/jni.cpp @@ -511,6 +511,19 @@ jlong JNICALL nativeAddPolyline(JNIEnv *env, jobject obj, jlong nativeMapViewPtr return -1; } + jobjectArray array = + reinterpret_cast(env->CallObjectMethod(points, listToArrayId)); + if (env->ExceptionCheck() || (array == nullptr)) { + env->ExceptionDescribe(); + return -1; + } + + jsize len = env->GetArrayLength(array); + if (len < 0) { + env->ExceptionDescribe(); + return -1; + } + return (jlong)width; }