aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2021-03-05 11:10:11 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2021-03-05 11:10:11 +0100
commitbea4eccca1fce36e643318be1085031cae4e0774 (patch)
treee597362dae6664192222af070809405cec086b51 /ui
parent126768d9ef06b0bfd557c93aa037ada4fe2f9ce8 (diff)
downloadpoe-bea4eccca1fce36e643318be1085031cae4e0774.tar.gz
poe-bea4eccca1fce36e643318be1085031cae4e0774.tar.bz2
poe-bea4eccca1fce36e643318be1085031cae4e0774.zip
Fix column out of bounds bug.
Diffstat (limited to 'ui')
-rw-r--r--ui/tcell/layout.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/tcell/layout.go b/ui/tcell/layout.go
index bc30f8c..cb2396c 100644
--- a/ui/tcell/layout.go
+++ b/ui/tcell/layout.go
@@ -41,6 +41,9 @@ func (wrk *Workspace) CloseCol(c *Column) {
}
func (wrk *Workspace) Col(i int) *Column {
+ if i > len(wrk.cols)-1 {
+ return nil
+ }
return wrk.cols[i]
}