Skip to content

Commit f742b86

Browse files
authored
fix: add legacy options safety
1 parent 7f7665a commit f742b86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/nvim-tree/legacy.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ local function refactored(opts)
2323
utils.move_missing_val(opts, "trash", "require_confirm", opts, "ui.confirm", "trash", true)
2424

2525
-- 2023/01/15
26-
if opts.view and opts.view.adaptive_size ~= nil then
26+
if type(opts.view) == "table" and opts.view.adaptive_size ~= nil then
2727
if opts.view.adaptive_size and type(opts.view.width) ~= "table" then
2828
local width = opts.view.width
2929
opts.view.width = {
@@ -52,7 +52,7 @@ local function refactored(opts)
5252
end
5353

5454
local function deprecated(opts)
55-
if opts.view and opts.view.hide_root_folder then
55+
if type(opts.view) == "table" and opts.view.hide_root_folder then
5656
notify.info "view.hide_root_folder is deprecated, please set renderer.root_folder_label = false"
5757
end
5858
end

0 commit comments

Comments
 (0)