fix: nil access exception with git integration when changing branches (#2774)

Fix nil access exception appearing when changing branches
This commit is contained in:
Jacob Kania 2024-05-14 02:31:56 +02:00 committed by GitHub
parent edd4e25fd4
commit 340d3a9795
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,7 +29,7 @@ end
---@param absolute_path string
---@return GitStatus
local function get_git_status(parent_ignored, status, absolute_path)
local file_status = parent_ignored and "!!" or status.files and status.files[absolute_path]
local file_status = parent_ignored and "!!" or (status and status.files and status.files[absolute_path])
return { file = file_status }
end