Skip to content

Commit

Permalink
[fix] 修复了直接访问profile, user, admin试图获取帮助时崩溃的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Eticeweng committed Jun 19, 2022
1 parent 4d144e5 commit 1e914f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CommandSystem/CommandsResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,23 @@ public static CommandPipeline resolve(String cmd){
if (fields.length < Commands.PROFILE.getParamsCount() + 1){
pipeline.setCommand(Commands.PROFILE)
.setParams(paramsResolve(Arrays.copyOfRange(fields, 1, fields.length)));
break;
}
pipeline = profileResolve(Arrays.copyOfRange(fields, 1, fields.length));
break;
case "user":
if (fields.length < Commands.USER.getParamsCount() + 1){
pipeline.setCommand(Commands.USER)
.setParams(paramsResolve(Arrays.copyOfRange(fields, 1, fields.length)));
break;
}
pipeline = userResolve(Arrays.copyOfRange(fields, 1, fields.length));
break;
case "admin":
if (fields.length < Commands.ADMIN.getParamsCount() + 1){
pipeline.setCommand(Commands.ADMIN)
.setParams(paramsResolve(Arrays.copyOfRange(fields, 1, fields.length)));
break;
}
pipeline = adminResolve(Arrays.copyOfRange(fields, 1, fields.length));
break;
Expand Down

0 comments on commit 1e914f0

Please sign in to comment.