Skip to content

Commit

Permalink
<fix>(jni): fix jni method null point coredump.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyonRay committed Jan 2, 2024
1 parent 5863b9d commit 17bc41b
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 118 deletions.
23 changes: 19 additions & 4 deletions bindings/java/jni/src/main/c/jni/org_fisco_bcos_sdk_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@
extern "C" {
#endif

#define GET_J_STRING_CONTENT(env, jstr) \
(env)->GetStringUTFChars((jstr), NULL)
#define GET_J_STRING_CONTENT(env, jstr) (env)->GetStringUTFChars((jstr), NULL)
#define GET_J_STRING_CONTENT_DEF(env, jstr, def) \
((jstr) == NULL ? (def) : GET_J_STRING_CONTENT((env), (jstr)))
#define CHECK_OBJECT_NOT_NULL(env, obj, ret) \
if (NULL == (obj)) \
{ \
THROW_JNI_EXCEPTION((env), "illegal NULL " #obj " parameter"); \
return (ret); \
}
#define CHECK_OBJECT_NOT_NULL_RET_VOID(env, obj) \
if (NULL == (obj)) \
{ \
THROW_JNI_EXCEPTION((env), "illegal NULL " #obj " parameter"); \
return; \
}

struct cb_context
{
Expand All @@ -27,20 +38,24 @@ jclass bcos_sdk_c_find_jclass(JNIEnv* env, const char* className);
struct bcos_sdk_c_config* create_config_from_java_obj(JNIEnv* env, jobject jconfig);

// check jstring not null
inline void checkJString(JNIEnv* env, jstring jstr)
inline bool checkJString(JNIEnv* env, jstring jstr)
{
if (jstr == NULL)
{
THROW_JNI_EXCEPTION(env, "illegal NULL string parameter");
return false;
}
return true;
}
// check jByteArray not null
inline void checkJByteArray(JNIEnv* env, jbyteArray jbyte_array)
inline bool checkJByteArray(JNIEnv* env, jbyteArray jbyte_array)
{
if (jbyte_array == NULL)
{
THROW_JNI_EXCEPTION(env, "illegal NULL byteArray parameter");
return false;
}
return true;
}

#ifdef __cplusplus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
JNIEXPORT jlong JNICALL Java_org_fisco_bcos_sdk_jni_BcosSDKJniObj_create(
JNIEnv* env, jclass self, jobject jconfig)
{
CHECK_OBJECT_NOT_NULL(env, jconfig, 0);
(void)self;
// config
struct bcos_sdk_c_config* config = create_config_from_java_obj(env, jconfig);
Expand Down Expand Up @@ -163,7 +164,7 @@ JNIEXPORT jint JNICALL Java_org_fisco_bcos_sdk_jni_BcosSDKJniObj_negotiatedProto
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_BcosSDKJniObj_registerBlockNotifier(
JNIEnv* env, jobject self, jstring jgroup, jobject jcallback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

void* sdk = bcos_sdk_get_native_pointer(env, self);
if (!sdk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ JNIEXPORT void JNICALL
Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_subscribeTopic__Ljava_lang_String_2Lorg_fisco_bcos_sdk_jni_amop_AmopRequestCallback_2(
JNIEnv* env, jobject self, jstring jtopic, jobject jcallback)
{
checkJString(env, jtopic);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jtopic);

void* sdk = bcos_sdk_get_native_pointer(env, self);

Expand Down Expand Up @@ -214,6 +214,7 @@ Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_subscribeTopic__Ljava_lang_String_2L
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_subscribeTopic__Ljava_util_Set_2(
JNIEnv* env, jobject self, jobject jtopics)
{
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jtopics);
void* sdk = bcos_sdk_get_native_pointer(env, self);

jclass setClass = env->GetObjectClass(jtopics);
Expand Down Expand Up @@ -263,7 +264,7 @@ JNIEXPORT void JNICALL
Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_subscribeTopic__Ljava_lang_String_2Lorg_fisco_bcos_sdk_jni_amop_AmopJniObjRequestCallback_2(
JNIEnv* env, jobject self, jstring jtopic, jobject jcallback)
{
checkJString(env, jtopic);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jtopic);
void* sdk = bcos_sdk_get_native_pointer(env, self);

const char* topic = env->GetStringUTFChars(jtopic, 0);
Expand Down Expand Up @@ -295,6 +296,7 @@ Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_subscribeTopic__Ljava_lang_String_2L
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_unsubscribeTopic(
JNIEnv* env, jobject self, jobject jtopics)
{
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jtopics);
void* sdk = bcos_sdk_get_native_pointer(env, self);

jclass setClass = env->GetObjectClass(jtopics);
Expand Down Expand Up @@ -366,8 +368,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_setCallback(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_sendAmopMsg(
JNIEnv* env, jobject self, jstring jtopic, jbyteArray jdata, jint jtimeout, jobject jcallback)
{
checkJString(env, jtopic);
checkJByteArray(env, jdata);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jtopic);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jdata);
void* sdk = bcos_sdk_get_native_pointer(env, self);

// Note: The JNIEnv pointer, passed as the first argument to every native method, can only be
Expand Down Expand Up @@ -404,8 +406,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_sendAmopMsg(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_broadcastAmopMsg(
JNIEnv* env, jobject self, jstring jtopic, jbyteArray jdata)
{
checkJString(env, jtopic);
checkJByteArray(env, jdata);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jtopic);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jdata);
void* sdk = bcos_sdk_get_native_pointer(env, self);

const char* topic = env->GetStringUTFChars(jtopic, 0);
Expand All @@ -426,9 +428,9 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_broadcastAmop
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_amop_AmopJniObj_sendResponse(
JNIEnv* env, jobject self, jstring jendpoint, jstring jseq, jbyteArray jdata)
{
checkJString(env, jendpoint);
checkJString(env, jseq);
checkJByteArray(env, jdata);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jendpoint);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jseq);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jdata);
void* sdk = bcos_sdk_get_native_pointer(env, self);

const char* endpoint = env->GetStringUTFChars(jendpoint, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_event_EventSubJniObj_stop(
JNIEXPORT jstring JNICALL Java_org_fisco_bcos_sdk_jni_event_EventSubJniObj_subscribeEvent(
JNIEnv* env, jobject self, jstring jgroup, jstring jparams, jobject jcallback)
{
checkJString(env, jgroup);
checkJString(env, jparams);
CHECK_OBJECT_NOT_NULL(env, jgroup, NULL);
CHECK_OBJECT_NOT_NULL(env, jparams, NULL);

void* sdk = bcos_sdk_get_native_pointer(env, self);
const char* group = env->GetStringUTFChars(jgroup, 0);
Expand Down Expand Up @@ -171,7 +171,7 @@ JNIEXPORT jstring JNICALL Java_org_fisco_bcos_sdk_jni_event_EventSubJniObj_subsc
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_event_EventSubJniObj_unsubscribeEvent(
JNIEnv* env, jobject self, jstring jeventId)
{
checkJString(env, jeventId);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jeventId);
void* sdk = bcos_sdk_get_native_pointer(env, self);
const char* eventid = env->GetStringUTFChars(jeventId, 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ JNIEXPORT void JNICALL
Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_genericMethod__Ljava_lang_String_2Lorg_fisco_bcos_sdk_jni_rpc_RpcCallback_2(
JNIEnv* env, jobject self, jstring jdata, jobject jcallback)
{
checkJString(env, jdata);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jdata);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);

Expand Down Expand Up @@ -184,8 +184,8 @@ JNIEXPORT void JNICALL
Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_genericMethod__Ljava_lang_String_2Ljava_lang_String_2Lorg_fisco_bcos_sdk_jni_rpc_RpcCallback_2(
JNIEnv* env, jobject self, jstring jgroup, jstring jdata, jobject jcallback)
{
checkJString(env, jgroup);
checkJString(env, jdata);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jdata);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);

Expand Down Expand Up @@ -223,8 +223,8 @@ JNIEXPORT void JNICALL
Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_genericMethod__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Lorg_fisco_bcos_sdk_jni_rpc_RpcCallback_2(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jstring jdata, jobject jcallback)
{
checkJString(env, jgroup);
checkJString(env, jdata);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jdata);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);

Expand Down Expand Up @@ -265,9 +265,9 @@ Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_genericMethod__Ljava_lang_String_2Ljav
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_call(JNIEnv* env, jobject self,
jstring jgroup, jstring jnode, jstring jto, jstring jdata, jobject callback)
{
checkJString(env, jgroup);
checkJString(env, jto);
checkJString(env, jdata);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jto);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jdata);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
// group
Expand Down Expand Up @@ -309,8 +309,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_call(JNIEnv* en
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_sendTransaction(JNIEnv* env,
jobject self, jstring jgroup, jstring jnode, jstring jdata, jboolean jproof, jobject callback)
{
checkJString(env, jgroup);
checkJString(env, jdata);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jdata);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -353,8 +353,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getTransaction(
jobject self, jstring jgroup, jstring jnode, jstring jtx_hash, jboolean jproof,
jobject callback)
{
checkJString(env, jgroup);
checkJString(env, jtx_hash);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jtx_hash);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
// group
Expand Down Expand Up @@ -396,8 +396,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getTransactionR
jobject self, jstring jgroup, jstring jnode, jstring jtx_hash, jboolean jproof,
jobject callback)
{
checkJString(env, jgroup);
checkJString(env, jtx_hash);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jtx_hash);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
// group
Expand Down Expand Up @@ -440,8 +440,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockByHash(
jobject self, jstring jgroup, jstring jnode, jstring jblock_hash, jboolean jonly_header,
jboolean jonly_txhash, jobject callback)
{
checkJString(env, jgroup);
checkJString(env, jblock_hash);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jblock_hash);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
// group
Expand Down Expand Up @@ -485,7 +485,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockByNumbe
jobject self, jstring jgroup, jstring jnode, jlong jnumber, jboolean jonly_header,
jboolean jonly_txhash, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
// group
Expand Down Expand Up @@ -527,7 +527,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockByNumbe
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockHashByNumber(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jlong jnumber, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -566,7 +566,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockHashByN
JNIEXPORT jlong JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockLimit(
JNIEnv* env, jobject self, jstring jgroup)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL(env, jgroup, 0);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand All @@ -586,7 +586,7 @@ JNIEXPORT jlong JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockLimit(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockNumber(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -623,8 +623,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getBlockNumber(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getCode(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jstring jaddress, jobject callback)
{
checkJString(env, jgroup);
checkJString(env, jaddress);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jaddress);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
// group
Expand Down Expand Up @@ -662,7 +662,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getCode(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getSealerList(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -698,7 +698,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getSealerList(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getObserverList(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -734,7 +734,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getObserverList
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getPbftView(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -769,7 +769,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getPbftView(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getPendingTxSize(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -805,7 +805,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getPendingTxSiz
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getSyncStatus(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -841,8 +841,8 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getSyncStatus(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getSystemConfigByKey(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jstring jkey, jobject callback)
{
checkJString(env, jgroup);
checkJString(env, jkey);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jkey);
// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
// group
Expand Down Expand Up @@ -880,7 +880,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getSystemConfig
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getTotalTransactionCount(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -916,7 +916,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getTotalTransac
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getGroupPeers(
JNIEnv* env, jobject self, jstring jgroup, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -1003,7 +1003,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getGroupList(
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getGroupInfo(
JNIEnv* env, jobject self, jstring jgroup, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down Expand Up @@ -1063,7 +1063,7 @@ JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getGroupInfoLis
JNIEXPORT void JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcJniObj_getGroupNodeInfo(
JNIEnv* env, jobject self, jstring jgroup, jstring jnode, jobject callback)
{
checkJString(env, jgroup);
CHECK_OBJECT_NOT_NULL_RET_VOID(env, jgroup);

// rpc obj handler
void* rpc = bcos_sdk_get_native_pointer(env, self);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ JNIEXPORT jstring JNICALL Java_org_fisco_bcos_sdk_jni_rpc_RpcServiceJniObj_sendT
JNIEnv* env, jclass, jlong jsdk, jlong jkeypair, jstring jgroup, jstring jnode, jstring jto,
jbyteArray jdata, jstring jabi, jint jatti, jstring jextra_data, jobject jcallback)
{
checkJString(env, jgroup);
checkJByteArray(env, jdata);
CHECK_OBJECT_NOT_NULL(env, jgroup, NULL);
CHECK_OBJECT_NOT_NULL(env, jdata, NULL);

void* sdk = reinterpret_cast<void*>(jsdk);
void* keypair = reinterpret_cast<void*>(jkeypair);
Expand Down
Loading

0 comments on commit 17bc41b

Please sign in to comment.