fix: No crash on logging out in client chooser button

pull/1925/head
Christian Kußowski 3 months ago
parent 6583bfdabf
commit 3078e9788f
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -156,7 +156,7 @@ class ClientChooserButton extends StatelessWidget {
var clientCount = 0;
matrix.accountBundles.forEach((key, value) => clientCount += value.length);
return FutureBuilder<Profile>(
future: matrix.client.fetchOwnProfile(),
future: matrix.client.isLogged() ? matrix.client.fetchOwnProfile() : null,
builder: (context, snapshot) => Material(
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(99),
@ -171,7 +171,7 @@ class ClientChooserButton extends StatelessWidget {
child: Avatar(
mxContent: snapshot.data?.avatarUrl,
name:
snapshot.data?.displayName ?? matrix.client.userID!.localpart,
snapshot.data?.displayName ?? matrix.client.userID?.localpart,
size: 32,
),
),

Loading…
Cancel
Save