Skip to content

Commit 43e76cc

Browse files
authored
fix: tostring(vim.version()) fails if build is NIL neovim#24097
Problem: Since neovim#23925, Version.build may be vim.NIL, which causes tostring() to fail: E5108: Error executing lua E5114: Error while converting print argument #1: …/version.lua:129: attempt to concatenate field 'build' (a userdata value) stack traceback: [C]: in function 'print' [string ":lua"]:1: in main chunk Solution: Handle vim.NIL in Version:__tostring().
1 parent 08db61b commit 43e76cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/lua/vim/version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function Version:__tostring()
125125
if self.prerelease then
126126
ret = ret .. '-' .. self.prerelease
127127
end
128-
if self.build then
128+
if self.build and self.build ~= vim.NIL then
129129
ret = ret .. '+' .. self.build
130130
end
131131
return ret

0 commit comments

Comments
 (0)