diff --git a/changelog.md b/changelog.md index b6caa5050..6dd682698 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## Unreleased +* `FIX` Comparison crash in doc export CLI [#3111](https://github.com/LuaLS/lua-language-server/issues/3111) ## 3.16.0 `2025-12-2` diff --git a/script/cli/doc/export.lua b/script/cli/doc/export.lua index cd356b167..4c1403099 100644 --- a/script/cli/doc/export.lua +++ b/script/cli/doc/export.lua @@ -72,11 +72,11 @@ function export.positionOf(rowcol) end function export.sortDoc(a,b) - if a.name ~= b.name then + if a.name and b.name and a.name ~= b.name then return a.name < b.name end - if a.file ~= b.file then + if a.file and b.file and a.file ~= b.file then return a.file < b.file end