diff options
author | 2018-08-29 15:10:51 +0300 | |
---|---|---|
committer | 2018-08-29 15:10:51 +0300 | |
commit | 61a28570ca25ae789cca09736ddc427e172ac213 (patch) | |
tree | b1f490597d5f2999121310ae479b38e33eb5fb71 /juick-common/src/main/java/com/juick/server/CommandsManager.java | |
parent | 22514aa83e418770c8f60ea1b5ce943daa2383ef (diff) |
getUserByName is non nullable
Diffstat (limited to 'juick-common/src/main/java/com/juick/server/CommandsManager.java')
-rw-r--r-- | juick-common/src/main/java/com/juick/server/CommandsManager.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/juick-common/src/main/java/com/juick/server/CommandsManager.java b/juick-common/src/main/java/com/juick/server/CommandsManager.java index 58c07255..50cdb202 100644 --- a/juick-common/src/main/java/com/juick/server/CommandsManager.java +++ b/juick-common/src/main/java/com/juick/server/CommandsManager.java @@ -229,7 +229,7 @@ public class CommandsManager { help = "BL @username - add @username to your blacklist") public CommandResult blacklistUser(User user_from, URI attachment, String... arguments) { User blUser = userService.getUserByName(arguments[0]); - if (blUser != null) { + if (!blUser.isAnonymous()) { PrivacyQueriesService.PrivacyResult result = privacyQueriesService.blacklistUser(user_from, blUser); if (result == PrivacyQueriesService.PrivacyResult.Added) { return CommandResult.fromString("User added to your blacklist"); @@ -243,7 +243,7 @@ public class CommandsManager { help = "BL *tag - add *tag to your blacklist") public CommandResult blacklistTag(User user_from, URI attachment, String... arguments) { User blUser = userService.getUserByName(arguments[0]); - if (blUser != null) { + if (!blUser.isAnonymous()) { Tag tag = tagService.getTag(arguments[0], false); if (tag != null) { PrivacyQueriesService.PrivacyResult result = privacyQueriesService.blacklistTag(user_from, tag); |