mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
fix(lsp/java): NPE in completion provider if java file does not have package name
This commit is contained in:
Binary file not shown.
+1
-1
@@ -91,7 +91,7 @@ abstract class IJavaCompletionProvider(
|
||||
endsWithParen: Boolean,
|
||||
): CompletionResult {
|
||||
val root = task.root(file)
|
||||
filePackage = root.`package`.packageName.toString()
|
||||
filePackage = root.`package`?.packageName?.toString() ?: ""
|
||||
fileImports = root.imports.map { it.qualifiedIdentifier.toString() }.toSet()
|
||||
abortIfCancelled()
|
||||
abortCompletionIfCancelled()
|
||||
|
||||
Reference in New Issue
Block a user