mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-22 14:22:23 +00:00
invert logic in a couple of places and return early
This commit is contained in:
parent
4ee73fa272
commit
e1c16a8e68
@ -175,22 +175,18 @@ 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);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
jobject inetAddressObject = newInetAddress(env, addr);
|
||||
|
||||
if(env->ExceptionCheck() || inetAddressObject == NULL)
|
||||
{
|
||||
LOGE("Error creating new inet address");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int port = 0;
|
||||
switch(addr.ss_family)
|
||||
|
@ -233,12 +233,13 @@ namespace {
|
||||
case ZT_EVENT_TRACE: {
|
||||
LOGV("Trace Event");
|
||||
// call onTrace()
|
||||
if (data != NULL) {
|
||||
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:
|
||||
case ZT_EVENT_REMOTE_TRACE:
|
||||
|
Loading…
Reference in New Issue
Block a user