mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-04 03:48:07 +02:00
avoid nil pointer reference on startup
This commit is contained in:
parent
6473e5ca3c
commit
1f756d3d0a
8
main.go
8
main.go
@ -53,7 +53,13 @@ func main() {
|
||||
}
|
||||
|
||||
app, err := app.NewApp(appConfig)
|
||||
app.Log.Info(err)
|
||||
if err != nil {
|
||||
// TODO: remove this call to panic after anonymous error reporting
|
||||
// is setup (right now the call to panic logs nothing to the screen which
|
||||
// would make debugging difficult
|
||||
panic(err)
|
||||
// app.Log.Panic(err.Error())
|
||||
}
|
||||
app.GitCommand.SetupGit()
|
||||
app.Gui.RunWithSubprocesses()
|
||||
}
|
||||
|
@ -48,21 +48,21 @@ func NewApp(config config.AppConfigurer) (*App, error) {
|
||||
app.Log = newLogger(config)
|
||||
app.OSCommand, err = commands.NewOSCommand(app.Log)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return app, err
|
||||
}
|
||||
|
||||
app.Tr, err = i18n.NewLocalizer(app.Log)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return app, err
|
||||
}
|
||||
|
||||
app.GitCommand, err = commands.NewGitCommand(app.Log, app.OSCommand)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return app, err
|
||||
}
|
||||
app.Gui, err = gui.NewGui(app.Log, app.GitCommand, app.OSCommand, app.Tr, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return app, err
|
||||
}
|
||||
return app, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user