Skip to content

Commit 397df84

Browse files
authored
Merge pull request #3309 from dljsjr/patch-1
Add nil checks for name and file in sortDoc
2 parents 9c9a171 + be40d84 commit 397df84

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
5+
* `FIX` Comparison crash in doc export CLI [#3111](https://github.com/LuaLS/lua-language-server/issues/3111)
56

67
## 3.16.0
78
`2025-12-2`

script/cli/doc/export.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ function export.positionOf(rowcol)
7272
end
7373

7474
function export.sortDoc(a,b)
75-
if a.name ~= b.name then
75+
if a.name and b.name and a.name ~= b.name then
7676
return a.name < b.name
7777
end
7878

79-
if a.file ~= b.file then
79+
if a.file and b.file and a.file ~= b.file then
8080
return a.file < b.file
8181
end
8282

0 commit comments

Comments
 (0)