Skip to content

Commit

Permalink
fix(screens): fix history and project diff screens crashing on projec…
Browse files Browse the repository at this point in the history
…ts without a git dir
  • Loading branch information
tanvirtin committed Apr 4, 2024
1 parent 271db6f commit 9518b81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/vgit/features/screens/HistoryScreen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ function HistoryScreen:show()
local buffer = Buffer(0)
local err = self.store:fetch(self.layout_type, buffer.filename)

loop.free_textlock()
if err then
console.debug.error(err).error(err)
return false
end

-- Show and bind data (data will have all the necessary shape required)
loop.free_textlock()
self.diff_view:define()
self.table_view:define()

Expand Down
1 change: 1 addition & 0 deletions lua/vgit/features/screens/ProjectDiffScreen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ function ProjectDiffScreen:show()
loop.free_textlock()
local err, data = self.store:fetch(self.layout_type)

loop.free_textlock()
if err then
console.debug.error(err).error(err)

Expand Down

0 comments on commit 9518b81

Please sign in to comment.