diff --git a/src/Hangfire.Console/GlobalConfigurationExtensions.cs b/src/Hangfire.Console/GlobalConfigurationExtensions.cs index 33b3f87..dd1f026 100644 --- a/src/Hangfire.Console/GlobalConfigurationExtensions.cs +++ b/src/Hangfire.Console/GlobalConfigurationExtensions.cs @@ -28,13 +28,13 @@ public static IGlobalConfiguration UseConsole(this IGlobalConfiguration configur throw new ArgumentNullException(nameof(configuration)); } - options = options ?? new ConsoleOptions(); + options ??= new ConsoleOptions(); options.Validate(nameof(options)); if (DashboardRoutes.Routes.Contains("/console/([0-9a-f]{11}.+)")) { - throw new InvalidOperationException("Console is already initialized"); + return configuration; } // register server filter for jobs