From 5a0214613251d5649829be471d5f24b1d0b2af61 Mon Sep 17 00:00:00 2001 From: Austin Keener Date: Thu, 13 Oct 2016 14:37:44 -0400 Subject: [PATCH] Fixed logic problems --- .../java/net/dv8tion/jda/core/entities/impl/UserImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/dv8tion/jda/core/entities/impl/UserImpl.java b/src/main/java/net/dv8tion/jda/core/entities/impl/UserImpl.java index 6275aaf61d..95ab82034b 100644 --- a/src/main/java/net/dv8tion/jda/core/entities/impl/UserImpl.java +++ b/src/main/java/net/dv8tion/jda/core/entities/impl/UserImpl.java @@ -93,6 +93,8 @@ public RestAction 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()); @@ -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;