better handle when room is null

This commit is contained in:
Henry Hiles 2026-06-05 18:33:16 -04:00
commit 02b7892fb0
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
4 changed files with 42 additions and 37 deletions

View file

@ -39,9 +39,7 @@ class Sidebar extends HookConsumerWidget {
(room) => room.metadata?.id == selectedRoomId,
);
final selectedRoomIndex = indexOfSelectedRoom == -1
? selectedSpace.children.isEmpty
? null
: 0
? null
: indexOfSelectedRoom;
return Drawer(