fix: fallback on homeserver is userID null

Signed-off-by: The one with the braid <info@braid.business>
This commit is contained in:
The one with the braid 2025-05-16 09:44:15 +02:00
parent 39d7b40ac7
commit ee51dfcca6
No known key found for this signature in database
GPG Key ID: 79D2235BC19FF56A
1 changed files with 4 additions and 1 deletions

View File

@ -583,7 +583,10 @@ class Client extends MatrixApi {
@override
Future<DiscoveryInformation> getWellknown() async {
final wellKnownResponse = await httpClient.get(
Uri.https(userID!.domain!, '/.well-known/matrix/client'),
Uri.https(
userID?.domain ?? homeserver!.host,
'/.well-known/matrix/client',
),
);
final wellKnown = DiscoveryInformation.fromJson(
jsonDecode(utf8.decode(wellKnownResponse.bodyBytes))