From 5affd9f061e75f6575a2fe6715f9e8757cfe87e8 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Thu, 14 Dec 2023 07:20:46 +0100 Subject: Cleanup --- Utilities/LibMatrix.Utilities.Bot/BotCommandInstaller.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Utilities/LibMatrix.Utilities.Bot/BotCommandInstaller.cs') diff --git a/Utilities/LibMatrix.Utilities.Bot/BotCommandInstaller.cs b/Utilities/LibMatrix.Utilities.Bot/BotCommandInstaller.cs index 91ec1e8..25a8d92 100644 --- a/Utilities/LibMatrix.Utilities.Bot/BotCommandInstaller.cs +++ b/Utilities/LibMatrix.Utilities.Bot/BotCommandInstaller.cs @@ -21,8 +21,8 @@ public static class BotCommandInstaller { services.AddSingleton(); services.AddScoped(x => { - var config = x.GetService(); - var hsProvider = x.GetService(); + var config = x.GetService() ?? throw new Exception("No configuration found!"); + var hsProvider = x.GetService() ?? throw new Exception("No homeserver provider found!"); var hs = hsProvider.GetAuthenticatedWithToken(config.Homeserver, config.AccessToken).Result; return hs; -- cgit 1.4.1