Skip to content

Commit

Permalink
check for nullptr to avoid a possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Dec 25, 2024
1 parent 177341e commit 77c9774
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jni-c-toxcore/jni-c-toxcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -4777,6 +4777,11 @@ Java_com_zoffcc_applications_trifa_MainActivity_tox_1self_1set_1nospam(JNIEnv *e
JNIEXPORT jlong JNICALL
Java_com_zoffcc_applications_trifa_MainActivity_tox_1self_1get_1nospam(JNIEnv *env, jobject thiz)
{
if(tox_global == NULL)
{
return -1;
}

uint32_t nospam = tox_self_get_nospam(tox_global);
return (jlong)nospam;
}
Expand Down

0 comments on commit 77c9774

Please sign in to comment.