mirror of
https://github.com/bitwarden/server
synced 2026-02-14 15:33:35 +00:00
Add null check for instanceName to prevent an unlikely null ref
This commit is contained in:
@@ -35,8 +35,13 @@ public abstract class BaseJobsHostedService : IHostedService, IDisposable
|
||||
|
||||
public virtual async Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var fullName = GetType().FullName;
|
||||
if (fullName == null)
|
||||
{
|
||||
throw new InvalidOperationException("Hosted service must have a valid type name.");
|
||||
}
|
||||
var schedulerBuilder = SchedulerBuilder.Create()
|
||||
.WithName(GetType().FullName) // Ensure each project has a unique instanceName
|
||||
.WithName(fullName) // Ensure each project has a unique instanceName
|
||||
.WithId("AUTO")
|
||||
.UseJobFactory<JobFactory>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user