Skip to content
This repository was archived by the owner on Jul 24, 2021. It is now read-only.

Commit 217a250

Browse files
committed
🐛 Fix permissions problems
1 parent 812324a commit 217a250

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/fr/bakaaless/api/command/CommandManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,20 @@ else if (toExec.getSecond().length() < aliases.length())
117117

118118
if (isCommandInExec) {
119119
final RunCommand annotation = getAnnotationCommand(toExec.getFirst());
120+
assert annotation != null;
120121
permission = annotation.permission();
121122
executorType = annotation.executor();
122123
argumentSize = annotation.arguments();
123124
}
124125
else {
125126
final RunSubCommand annotation = getAnnotationSubCommand(toExec.getFirst());
127+
assert annotation != null;
126128
permission = annotation.permission();
127129
executorType = annotation.executor();
128130
argumentSize = annotation.arguments();
129131
}
130132

131-
if (!sender.hasPermission(permission)) {
133+
if (!sender.hasPermission(permission) && !(permission.replace(" ", "").equals("") || permission.isEmpty())) {
132134
sender.sendMessage(Messages.ERROR_COMMAND_PERMISSION.get());
133135
return false;
134136
}

0 commit comments

Comments
 (0)