mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-03 00:57:52 +02:00
prevent crash when opening recent repos panel if no recent repos are present
This commit is contained in:
@ -60,8 +60,12 @@ func (gui *Gui) getCurrentBranch(path string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handleCreateRecentReposMenu() error {
|
func (gui *Gui) handleCreateRecentReposMenu() error {
|
||||||
// we skip the first one because we're currently in it
|
// we'll show an empty panel if there are no recent repos
|
||||||
recentRepoPaths := gui.c.GetAppState().RecentRepos[1:]
|
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{}
|
currentBranches := sync.Map{}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user