Merge pull request #2094 from TheOneWithTheBraid/braid/well-known-fix

fix: null check on Client.userID in Client.checkHomeserver
This commit is contained in:
Krille-chan 2025-05-20 10:22:57 +02:00 committed by GitHub
commit 8d8cbfb0b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -583,7 +583,10 @@ class Client extends MatrixApi {
@override @override
Future<DiscoveryInformation> getWellknown() async { Future<DiscoveryInformation> getWellknown() async {
final wellKnownResponse = await httpClient.get( 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( final wellKnown = DiscoveryInformation.fromJson(
jsonDecode(utf8.decode(wellKnownResponse.bodyBytes)) jsonDecode(utf8.decode(wellKnownResponse.bodyBytes))