fixes crash

This commit is contained in:
otsmr 2026-08-03 23:20:32 +02:00
parent b92ff26e81
commit b2274ee9f5

View file

@ -331,11 +331,17 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
), ),
if (group.isDirectChat) if (group.isDirectChat)
StreamBuilder<List<Contact>>( StreamBuilder<List<Contact>>(
stream: twonlyDB.groupsDao.watchGroupContact(group.groupId), stream: twonlyDB.groupsDao.watchGroupContact(
group.groupId,
),
builder: (context, snapshot) { builder: (context, snapshot) {
final contacts = snapshot.data ?? []; final contacts = snapshot.data ?? [];
if (contacts.isEmpty) return const SizedBox.shrink(); if (contacts.isEmpty) {
return ContactLabels(contactId: contacts.first.userId); return const SizedBox.shrink();
}
return ContactLabels(
contactId: contacts.first.userId,
);
}, },
), ),
], ],