We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46b4eb7 commit 40bc031Copy full SHA for 40bc031
lib/widgets/content.dart
@@ -836,6 +836,8 @@ class Avatar extends StatelessWidget {
836
837
/// The appropriate avatar image for a user ID.
838
///
839
+/// If the user isn't found, gives a [SizedBox.shrink].
840
+///
841
/// Wrap this with [AvatarShape].
842
class AvatarImage extends StatelessWidget {
843
const AvatarImage({
@@ -848,7 +850,12 @@ class AvatarImage extends StatelessWidget {
848
850
@override
849
851
Widget build(BuildContext context) {
852
final store = PerAccountStoreWidget.of(context);
- final user = store.users[userId]!;
853
+ final user = store.users[userId];
854
+
855
+ if (user == null) {
856
+ // TODO(log) log?
857
+ return const SizedBox.shrink();
858
+ }
859
860
final resolvedUrl = switch (user.avatarUrl) {
861
null => null, // TODO(#255): handle computing gravatars
0 commit comments