Skip to content

Commit

Permalink
fix: prevents NullReferenceException when a tenant resolver returns null
Browse files Browse the repository at this point in the history
  • Loading branch information
ethno2405 committed Jul 18, 2022
1 parent 449fadc commit d0839df
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Elders.Cronus/Multitenancy/ITenantResolver.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Elders.Cronus.AspNetCore.Exeptions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Reflection;
using Elders.Cronus.AspNetCore.Exeptions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;

namespace Elders.Cronus.Multitenancy
{
Expand Down Expand Up @@ -85,7 +85,7 @@ public ResolverCache(object resolver, MethodInfo resolveMethod)

public string GetTenantFrom(object source)
{
return _resolveMethod.Invoke(_resolver, new object[] { source }).ToString();
return _resolveMethod.Invoke(_resolver, new object[] { source })?.ToString();
}
}
}
Expand Down

0 comments on commit d0839df

Please sign in to comment.