Skip to content

Commit

Permalink
fix: when there is no buildPresets field, it should not popup error
Browse files Browse the repository at this point in the history
  • Loading branch information
Civitasv committed Dec 1, 2023
1 parent 8474524 commit f735377
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/cmake-tools/presets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ function presets.parse(type, opts, cwd)
if not data then
error("Error when parsing the presets file")
end
for _, v in pairs(data[type]) do
if include_hidden or not v["hidden"] then
table.insert(options, v["name"])
if data[type] then
for _, v in pairs(data[type]) do
if include_hidden or not v["hidden"] then
table.insert(options, v["name"])
end
end
end
return options
Expand Down

0 comments on commit f735377

Please sign in to comment.