1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00

prevent crash when opening recent repos panel if no recent repos are present

This commit is contained in:
Jesse Duffield 2022-08-01 22:10:08 +10:00
parent debc58b6c5
commit 3ee2ad511e

View File

@ -60,8 +60,12 @@ func (gui *Gui) getCurrentBranch(path string) string {
}
func (gui *Gui) handleCreateRecentReposMenu() error {
// we skip the first one because we're currently in it
recentRepoPaths := gui.c.GetAppState().RecentRepos[1:]
// we'll show an empty panel if there are no recent repos
recentRepoPaths := []string{}
if len(gui.c.GetAppState().RecentRepos) > 0 {
// we skip the first one because we're currently in it
recentRepoPaths = gui.c.GetAppState().RecentRepos[1:]
}
currentBranches := sync.Map{}