Skip to content

Commit

Permalink
fix: check if provider name is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
famiu committed Oct 11, 2021
1 parent 3b46ef0 commit 9c193bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/feline/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ local function parse_provider(provider, component)
elseif type(provider) == 'table' then
if not provider.name then
api.nvim_err_writeln("Provider table doesn't have the provider name")
elseif type(provider.name) ~= 'string' then
api.nvim_err_writeln(string.format(
"Expected 'string' for provider name, got '%s' instead",
type(provider.name)
))
elseif not providers[provider.name] then
api.nvim_err_writeln(string.format(
"Provider with name '%s' doesn't exist",
Expand Down

0 comments on commit 9c193bc

Please sign in to comment.