Skip to content

Commit 563d9f6

Browse files
authored
fix: accessing potentially empty title index (#303)
1 parent 6d54c19 commit 563d9f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/plenary/window/border.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ function Border:change_title(new_title, pos)
178178
return
179179
end
180180

181-
pos = pos or (self._border_win_options.title[1] and self._border_win_options.title[1].pos)
181+
pos = pos
182+
or (self._border_win_options.title and self._border_win_options.title[1] and self._border_win_options.title[1].pos)
182183
if pos == nil then
183184
self._border_win_options.title = new_title
184185
else

0 commit comments

Comments
 (0)