Added default return if instance not in list.

This commit is contained in:
Armin Novak 2017-10-17 09:12:27 +02:00
parent f1e8fdeb50
commit e7884aec26

View File

@ -99,7 +99,7 @@ public class LibFreeRDP {
if (mInstanceState.get(inst, false)) {
freerdp_disconnect(inst);
}
while(mInstanceState.get(inst)) {
while(mInstanceState.get(inst, false)) {
try {
mInstanceState.wait();
} catch (InterruptedException e) {
@ -121,7 +121,7 @@ public class LibFreeRDP {
public static boolean disconnect(long inst) {
synchronized (mInstanceState) {
if (mInstanceState.get(inst)) {
if (mInstanceState.get(inst, false)) {
return freerdp_disconnect(inst);
}
return true;
@ -130,7 +130,7 @@ public class LibFreeRDP {
public static boolean cancelConnection(long inst) {
synchronized (mInstanceState) {
if (mInstanceState.get(inst)) {
if (mInstanceState.get(inst, false)) {
return freerdp_disconnect(inst);
}
return true;