Skip to content

Commit

Permalink
fix(dep_graph): fix panic on selecting AUR providers (#2333)
Browse files Browse the repository at this point in the history
This commit fixes #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 <[email protected]>
  • Loading branch information
Juneezee authored Dec 11, 2023
1 parent 643830f commit d23e892
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/dep/dep_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand All @@ -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) {
Expand Down

0 comments on commit d23e892

Please sign in to comment.