fix: arithmetic on nil value error on first git project open (#3064)

* fixed error message when opening new git repo

* defensive nil + type check

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Hendrik Ziegler 2025-02-09 22:06:02 +01:00 committed by GitHub
parent 70825f23db
commit 80523101f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -389,9 +389,9 @@ function Explorer:populate_children(handle, cwd, node, project, parent)
nodes_by_path[child.absolute_path] = true
child:update_git_status(node_ignored, project)
end
else
elseif node.hidden_stats then
for reason, value in pairs(FILTER_REASON) do
if filter_reason == value then
if filter_reason == value and type(node.hidden_stats[reason]) == "number" then
node.hidden_stats[reason] = node.hidden_stats[reason] + 1
end
end