Return null, don't throw NullPointerException (#1131)

This commit is contained in:
Zak Shearman 2022-05-28 10:39:50 +01:00 committed by GitHub
parent a4f392d116
commit a01ff09563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,10 +86,7 @@ public class CommandContext {
}
public String getRaw(@NotNull String identifier) {
return rawArgs.computeIfAbsent(identifier, s -> {
throw new NullPointerException(
"The argument with the id '" + identifier + "' has no value assigned, be sure to check your arguments id, your syntax, and that you do not change the argument id dynamically.");
});
return rawArgs.get(identifier);
}
public void setArg(@NotNull String id, Object value, String rawInput) {