From 600dd0270300fa16715ab85b13924ca824f4a99c Mon Sep 17 00:00:00 2001 From: Gravita Date: Sat, 16 Apr 2022 19:16:40 +0700 Subject: [PATCH] [FIX] JLine complete NPE --- .../java/pro/gravit/utils/command/JLineCommandHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/command/JLineCommandHandler.java b/LauncherCore/src/main/java/pro/gravit/utils/command/JLineCommandHandler.java index bcb92bbd..e8a48d0b 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/command/JLineCommandHandler.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/command/JLineCommandHandler.java @@ -77,6 +77,9 @@ public void complete(LineReader reader, ParsedLine line, List candida }); } else { Command target = findCommand(line.words().get(0)); + if(target == null) { + return; + } List words = line.words(); List candidates1 = target.complete(words.subList(1, words.size()), line.wordIndex() - 1, completeWord); candidates.addAll(candidates1);