Skip to content

Commit

Permalink
Merge pull request #182 from hackclub/deactivated-error-fix
Browse files Browse the repository at this point in the history
Fix error when checking for deletion/deactivation
  • Loading branch information
polypixeldev authored Sep 23, 2024
2 parents fe5fa66 + 65d61ea commit e9309a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/hackclub/hccore/slack/SlackBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,13 @@ public boolean isDeactivated(String id) {

try {
var res = client.usersInfo(r -> r.token(getBotToken()).user(id));
var user = res.getUser();

return res.getUser().isDeleted();
if (user == null) {
return true;
} else {
return user.isDeleted();
}
} catch (SlackApiException e) {
return true;
} catch (IOException e) {
Expand Down

0 comments on commit e9309a2

Please sign in to comment.