fix: add legacy options safety

This commit is contained in:
Azad 2023-09-17 03:08:57 +02:00 committed by GitHub
parent 7f7665a17b
commit f742b86852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ local function refactored(opts)
utils.move_missing_val(opts, "trash", "require_confirm", opts, "ui.confirm", "trash", true)
-- 2023/01/15
if opts.view and opts.view.adaptive_size ~= nil then
if type(opts.view) == "table" and opts.view.adaptive_size ~= nil then
if opts.view.adaptive_size and type(opts.view.width) ~= "table" then
local width = opts.view.width
opts.view.width = {
@ -52,7 +52,7 @@ local function refactored(opts)
end
local function deprecated(opts)
if opts.view and opts.view.hide_root_folder then
if type(opts.view) == "table" and opts.view.hide_root_folder then
notify.info "view.hide_root_folder is deprecated, please set renderer.root_folder_label = false"
end
end