1
This commit is contained in:
@@ -161,7 +161,17 @@ namespace BITKit.Entities
|
||||
|
||||
if (instances.TryGetValue(h0, out var v0) is false)
|
||||
{
|
||||
instances[h0] = v0 = _entitiesInternal[id].ServiceProvider.GetRequiredService<T>();
|
||||
try
|
||||
{
|
||||
instances[h0] = v0 = _entitiesInternal[id].ServiceProvider.GetRequiredService<T>();
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
_logger.LogWarning($"Missing Entity {id},Ignore for now");
|
||||
|
||||
hashset.Remove(id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
array[i] = Unsafe.As<T>(v0);
|
||||
|
@@ -39,7 +39,7 @@ namespace BITKit.Entities
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_serviceProvider.Dispose();
|
||||
_serviceProvider?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user