From 259b4c2ae5c193174d94a41f59d943cab1392704 Mon Sep 17 00:00:00 2001 From: Vladimir Eliezer Tokarev Date: Sat, 26 Mar 2016 04:13:45 -0700 Subject: [PATCH] Anded return statment after onFailure for the object dont send onSucces. --- .../registry/AsyncRegistryCallbacks/GetGroupsCallback.java | 1 + .../registry/AsyncRegistryCallbacks/HasVotedCallback.java | 1 + .../registry/AsyncRegistryCallbacks/getVoterCallback.java | 1 + 3 files changed, 3 insertions(+) diff --git a/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/GetGroupsCallback.java b/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/GetGroupsCallback.java index 8012fb1..2bb3e03 100644 --- a/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/GetGroupsCallback.java +++ b/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/GetGroupsCallback.java @@ -42,6 +42,7 @@ public class GetGroupsCallback implements FutureCallback messages) { if (messages.isEmpty()){ callback.onFailure(new NotFoundException("Voter permissions not found in database")); + return; } BulletinBoardMessage message = getLatestMessage(messages); diff --git a/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/HasVotedCallback.java b/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/HasVotedCallback.java index 73570a5..091f243 100644 --- a/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/HasVotedCallback.java +++ b/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/HasVotedCallback.java @@ -22,6 +22,7 @@ public class HasVotedCallback implements FutureCallback messages) { if (messages.isEmpty()){ callback.onSuccess(false); + return; } callback.onSuccess(true); } diff --git a/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/getVoterCallback.java b/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/getVoterCallback.java index b7b503a..ce244ec 100644 --- a/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/getVoterCallback.java +++ b/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/getVoterCallback.java @@ -27,6 +27,7 @@ public class GetVoterCallback implements FutureCallback messages) { if(messages.isEmpty()){ callback.onFailure(new NotFoundException("Voter info not found in database.")); + return; } BulletinBoardMessage latestMessage = getLatestMessage(messages);