[FIX] JLine complete NPE

This commit is contained in:
Gravita 2022-04-16 19:16:40 +07:00
parent 2ff46420a8
commit 600dd02703

View file

@ -77,6 +77,9 @@ public void complete(LineReader reader, ParsedLine line, List<Candidate> candida
});
} else {
Command target = findCommand(line.words().get(0));
if(target == null) {
return;
}
List<String> words = line.words();
List<Candidate> candidates1 = target.complete(words.subList(1, words.size()), line.wordIndex() - 1, completeWord);
candidates.addAll(candidates1);