Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Resolve 'attempt to index local 'meta' (a nil value)' #547

Closed

Conversation

kenjiThiago
Copy link

After the changes on the commit 1f7da07, when adding more information on the column and having the option to show hidden files set to true, for example:

require("oil").setup({
    view_options = {
        show_hidden = true,
    },

    columns = {
        "size",
    },
})

When open nvim I get an error: attempt to index local 'meta' (a nil value) on the file 'files.lua', line 59

I changed the file 'columns.lua' and add the code:

  local meta = entry[FIELD_META]
  if not meta then
    return EMPTY
  end

to check if entry[FIELD_META] is nil, and if it is return EMPTY.

I don't know if is the best solution, but the changes seems to fix the issue.

@github-actions github-actions bot requested a review from stevearc January 4, 2025 09:02
@IanLiuTW
Copy link

IanLiuTW commented Jan 4, 2025

Having the exact same issue after update.

@datsfilipe
Copy link

Same issue here too, after the update.

@stevearc
Copy link
Owner

stevearc commented Jan 4, 2025

Appreciate jumping in to get the error fixed, but I went with a different approach (254bc66).

@stevearc stevearc closed this Jan 4, 2025
@kenjiThiago kenjiThiago deleted the meta-nil-value-error branch January 5, 2025 00:03
@kenjiThiago kenjiThiago restored the meta-nil-value-error branch January 5, 2025 00:06
@kenjiThiago kenjiThiago deleted the meta-nil-value-error branch January 5, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants