mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
fix CompletionAdaptor index out of bounds when the token is empty (#610)
This commit is contained in:
@@ -43,7 +43,7 @@ class CompletionAdaptor implements Completion {
|
||||
|
||||
@Override
|
||||
public void complete(List<String> candidates) {
|
||||
String lastToken = tokens.get(tokens.size() - 1).value();
|
||||
String lastToken = tokens.isEmpty() ? null : tokens.get(tokens.size() - 1).value();
|
||||
if(StringUtils.isBlank(lastToken)) {
|
||||
lastToken = "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user