diff options
| author | Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> | 2018-12-23 14:28:16 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-23 14:28:16 +0300 |
| commit | e566c4ba671ddb223f36cc78c4a1285cd53d767c (patch) | |
| tree | 3cc5751aaa71c99349876ef34d45cd165256b14f | |
| parent | Merge pull request #36 from isacikgoz/develop (diff) | |
| parent | suppress an ambigous bug (diff) | |
| download | gitbatch-e566c4ba671ddb223f36cc78c4a1285cd53d767c.tar.gz | |
Merge pull request #37 from isacikgoz/develop
suppress an ambigous bug
| -rw-r--r-- | pkg/gui/mainview.go | 3 | ||||
| -rw-r--r-- | pkg/gui/sideviews.go | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/pkg/gui/mainview.go b/pkg/gui/mainview.go index e4c0159..4661f43 100644 --- a/pkg/gui/mainview.go +++ b/pkg/gui/mainview.go @@ -101,6 +101,9 @@ func (gui *Gui) cursorUp(g *gocui.Gui, v *gocui.View) error { // rrequire a better implementation or the slice's order must be synchronized // with the views lines func (gui *Gui) getSelectedRepository() *git.RepoEntity { + if len(gui.State.Repositories) == 0 { + return nil + } v, _ := gui.g.View(mainViewFeature.Name) _, oy := v.Origin() _, cy := v.Cursor() diff --git a/pkg/gui/sideviews.go b/pkg/gui/sideviews.go index 6316255..a602b2e 100644 --- a/pkg/gui/sideviews.go +++ b/pkg/gui/sideviews.go @@ -14,6 +14,9 @@ var ( // refreshes the side views of the application for given git.RepoEntity struct func (gui *Gui) renderSideViews(e *git.RepoEntity) error { + if e == nil { + return nil + } var err error if err = gui.renderRemotes(e); err != nil { return err |
