avoid crash with dir preview when hidden changes

cc #615
This commit is contained in:
Gokcehan 2021-04-28 18:50:24 +03:00
parent 202a998731
commit 1bd78220e2

4
nav.go
View File

@ -243,6 +243,10 @@ func (dir *dir) name() string {
if len(dir.files) == 0 {
return ""
}
dir.ind = max(dir.ind, 0)
dir.ind = min(dir.ind, len(dir.files)-1)
return dir.files[dir.ind].Name()
}