Skip to content

Commit

Permalink
Fixed logic problems
Browse files Browse the repository at this point in the history
  • Loading branch information
DV8FromTheWorld committed Oct 13, 2016
1 parent 315cc3e commit 5a02146
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -93,6 +93,8 @@ public RestAction<PrivateChannel> openPrivateChannel()
{
if (privateChannel != null)
throw new IllegalStateException("A private channel already exists for this User!");
if (fake)
throw new IllegalStateException("Cannot open a PrivateChannel with a Fake user.");

Route.CompiledRoute route = Route.Self.CREATE_PRIVATE_CHANNEL.compile();
JSONObject body = new JSONObject().put("recipient_id", getId());
Expand All @@ -118,7 +120,7 @@ protected void handleResponse(Response response, Request request)
@Override
public PrivateChannel getPrivateChannel()
{
if (hasPrivateChannel())
if (!hasPrivateChannel())
throw new IllegalStateException("There is no PrivateChannel for this user yet! Use User#openPrivateChannel() first!");

return privateChannel;
Expand Down

0 comments on commit 5a02146

Please sign in to comment.