Skip to content

Commit

Permalink
fix: attempt to index field 'meta'
Browse files Browse the repository at this point in the history
  • Loading branch information
stevalkr committed Nov 11, 2024
1 parent c3ac284 commit a735e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/oil/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a735e8a

Please sign in to comment.