mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-22 06:17:48 +00:00
invert logic in a couple of places and return early
This commit is contained in:
parent
4ee73fa272
commit
e1c16a8e68
@ -175,20 +175,16 @@ jobject newInetSocketAddress(JNIEnv *env, const sockaddr_storage &addr)
|
||||
{
|
||||
LOGV("newInetSocketAddress Called");
|
||||
|
||||
jobject inetAddressObject = NULL;
|
||||
|
||||
if(addr.ss_family != 0)
|
||||
if(addr.ss_family == 0)
|
||||
{
|
||||
inetAddressObject = newInetAddress(env, addr);
|
||||
|
||||
if(env->ExceptionCheck() || inetAddressObject == NULL)
|
||||
{
|
||||
LOGE("Error creating new inet address");
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
|
||||
jobject inetAddressObject = newInetAddress(env, addr);
|
||||
|
||||
if(env->ExceptionCheck() || inetAddressObject == NULL)
|
||||
{
|
||||
LOGE("Error creating new inet address");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -233,11 +233,12 @@ namespace {
|
||||
case ZT_EVENT_TRACE: {
|
||||
LOGV("Trace Event");
|
||||
// call onTrace()
|
||||
if (data != NULL) {
|
||||
const char *message = (const char *) data;
|
||||
jstring messageStr = env->NewStringUTF(message);
|
||||
env->CallVoidMethod(ref->eventListener, EventListener_onTrace_method, messageStr);
|
||||
if (data == NULL) {
|
||||
break;
|
||||
}
|
||||
const char *message = (const char *) data;
|
||||
jstring messageStr = env->NewStringUTF(message);
|
||||
env->CallVoidMethod(ref->eventListener, EventListener_onTrace_method, messageStr);
|
||||
}
|
||||
break;
|
||||
case ZT_EVENT_USER_MESSAGE:
|
||||
|
Loading…
Reference in New Issue
Block a user