aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/view-main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/view-main.go b/ui/view-main.go
index c2cd30f..a2848e8 100644
--- a/ui/view-main.go
+++ b/ui/view-main.go
@@ -209,6 +209,9 @@ func (view *MainView) SwitchRoom(roomIndex int) {
if roomIndex < 0 {
roomIndex = len(view.roomIDs) - 1
}
+ if len(view.roomIDs) == 0 {
+ return
+ }
view.currentRoomIndex = roomIndex % len(view.roomIDs)
view.roomView.SwitchToPage(view.CurrentRoomID())
view.roomList.SetCurrentItem(roomIndex)