Return JNI_ERR on bad version to AttachCurrentThread

Change-Id: I056cfb0c28ae45033f2080ec99c368b7121f10f0
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index 726c80b..8da208f 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -377,7 +377,11 @@
   const char* thread_name = NULL;
   jobject thread_group = NULL;
   if (args != NULL) {
-    CHECK_GE(args->version, JNI_VERSION_1_2);
+    if (args->version < JNI_VERSION_1_2) {
+      LOG(WARNING) << "Failed to AttachCurrentThread due to insufficent version "
+                   << std::hex << args->version << " < JNI_VERSION_1_2(" << JNI_VERSION_1_2 << ")";
+      return JNI_ERR;
+    }
     thread_name = args->name;
     thread_group = args->group;
   }