From ccdeebdc1cc44f271da46edb07977ed82c6d2fa4 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 5 Jul 2024 22:58:32 +0100 Subject: [PATCH] fix npe --- src/main/java/cc/fascinated/bat/service/UserService.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/service/UserService.java b/src/main/java/cc/fascinated/bat/service/UserService.java index b3ad11b..324983c 100644 --- a/src/main/java/cc/fascinated/bat/service/UserService.java +++ b/src/main/java/cc/fascinated/bat/service/UserService.java @@ -79,11 +79,8 @@ public class UserService implements EventListener { * @return The user */ public BatUser getUser(@NonNull String id) { - User user = DiscordService.JDA.getUserById(id); - if (user == null) { - return null; - } - if (user.isBot()) { + User user = DiscordService.JDA.retrieveUserById(id).complete(); + if (user == null || user.isBot()) { return null; } return getUser(id, null);