fix(dep_graph): fix panic on selecting AUR providers (#2333)

This commit fixes https://github.com/Jguer/yay/issues/2289 by making
`provideMenu` returns the first option when it receives an error input
from the user (e.g. user sends EOF).

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun authored and GitHub committed 2023-12-11 17:45:54 +01:00
1 parent 643830fccd
commit d23e8925fa
1 file changed
+1 -3
+1 -3
View File
@@ -749,7 +749,7 @@ func (g *Grapher) provideMenu(dep string, options []aur.Pkg) *aur.Pkg {
if err != nil {
g.logger.Errorln(err)
break
return &options[0]
}
if numberBuf == "" {
@@ -772,8 +772,6 @@ func (g *Grapher) provideMenu(dep string, options []aur.Pkg) *aur.Pkg {
return &options[num-1]
}
return nil
}
func makeAURPKGFromSrcinfo(dbExecutor db.Executor, srcInfo *gosrc.Srcinfo) ([]*aur.Pkg, error) {