diff options
Diffstat (limited to '')
-rw-r--r-- | Utilities/LibMatrix.Utilities.Bot/BotCommandInstaller.cs | 4 |
1 files changed, 2 insertions, 2 deletions
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<LibMatrixBotConfiguration>(); services.AddScoped<AuthenticatedHomeserverGeneric>(x => { - var config = x.GetService<LibMatrixBotConfiguration>(); - var hsProvider = x.GetService<HomeserverProviderService>(); + var config = x.GetService<LibMatrixBotConfiguration>() ?? throw new Exception("No configuration found!"); + var hsProvider = x.GetService<HomeserverProviderService>() ?? throw new Exception("No homeserver provider found!"); var hs = hsProvider.GetAuthenticatedWithToken(config.Homeserver, config.AccessToken).Result; return hs; |