mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-03 11:44:09 +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");
|
LOGV("newInetSocketAddress Called");
|
||||||
|
|
||||||
jobject inetAddressObject = NULL;
|
if(addr.ss_family == 0)
|
||||||
|
|
||||||
if(addr.ss_family != 0)
|
|
||||||
{
|
{
|
||||||
inetAddressObject = newInetAddress(env, addr);
|
return NULL;
|
||||||
|
|
||||||
if(env->ExceptionCheck() || inetAddressObject == NULL)
|
|
||||||
{
|
|
||||||
LOGE("Error creating new inet address");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
jobject inetAddressObject = newInetAddress(env, addr);
|
||||||
|
|
||||||
|
if(env->ExceptionCheck() || inetAddressObject == NULL)
|
||||||
{
|
{
|
||||||
|
LOGE("Error creating new inet address");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,11 +233,12 @@ namespace {
|
|||||||
case ZT_EVENT_TRACE: {
|
case ZT_EVENT_TRACE: {
|
||||||
LOGV("Trace Event");
|
LOGV("Trace Event");
|
||||||
// call onTrace()
|
// call onTrace()
|
||||||
if (data != NULL) {
|
if (data == NULL) {
|
||||||
const char *message = (const char *) data;
|
break;
|
||||||
jstring messageStr = env->NewStringUTF(message);
|
|
||||||
env->CallVoidMethod(ref->eventListener, EventListener_onTrace_method, messageStr);
|
|
||||||
}
|
}
|
||||||
|
const char *message = (const char *) data;
|
||||||
|
jstring messageStr = env->NewStringUTF(message);
|
||||||
|
env->CallVoidMethod(ref->eventListener, EventListener_onTrace_method, messageStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ZT_EVENT_USER_MESSAGE:
|
case ZT_EVENT_USER_MESSAGE:
|
||||||
|
Loading…
Reference in New Issue
Block a user