From a735e8a972d4a56852024bd4e0002a205dd8a2a3 Mon Sep 17 00:00:00 2001 From: Steve Walker <65963536+etherswangel@users.noreply.github.com> Date: Mon, 11 Nov 2024 20:44:18 +0800 Subject: [PATCH] fix: attempt to index field 'meta' --- lua/oil/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/oil/init.lua b/lua/oil/init.lua index ab050114..657d4d3c 100644 --- a/lua/oil/init.lua +++ b/lua/oil/init.lua @@ -452,7 +452,7 @@ M.open_preview = function(opts, callback) if not entry then return finish("Could not find entry under cursor") end - if entry.meta ~= nil or entry.meta.stat ~= nil then + if entry.meta ~= nil and entry.meta.stat ~= nil then if entry.meta.stat.size >= config.preview.max_file_size_mb * 1e6 then return finish("File over " .. config.preview.max_file_size_mb .. "MB is too large to preview ") end