🐛 Fix bug render chat message on cannot find user
This commit is contained in:
parent
6af695d74e
commit
c7f059b6d7
@ -68,6 +68,7 @@ class SnAttachmentProvider {
|
||||
.toList();
|
||||
|
||||
for (final item in out) {
|
||||
if (item == null) continue;
|
||||
if (item.isAnalyzed && item.isUploaded) {
|
||||
_cache[item.rid] = item;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class ChatMessage extends StatelessWidget {
|
||||
final ud = context.read<UserDirectoryProvider>();
|
||||
final user = ud.getAccountFromCache(data.sender.accountId);
|
||||
|
||||
final isOwner = ua.isAuthorized && data.sender.accountId == ua.user!.id;
|
||||
final isOwner = ua.isAuthorized && data.sender.accountId == ua.user?.id;
|
||||
|
||||
final dateFormatter = DateFormat('MM/dd HH:mm');
|
||||
|
||||
@ -109,7 +109,7 @@ class ChatMessage extends StatelessWidget {
|
||||
Text(
|
||||
(data.sender.nick?.isNotEmpty ?? false)
|
||||
? data.sender.nick!
|
||||
: user!.nick,
|
||||
: user?.nick ?? 'unknown',
|
||||
).bold(),
|
||||
if (data.updatedAt != data.createdAt)
|
||||
Text(
|
||||
|
Loading…
Reference in New Issue
Block a user