Nullability fixes.

This commit is contained in:
Pieter-Jan Briers
2020-08-20 16:48:00 +02:00
parent 3372ab050c
commit ed1a96e536
47 changed files with 159 additions and 158 deletions

View File

@@ -179,7 +179,7 @@ namespace Content.Shared.GameObjects.EntitySystems
}
private static bool TryGetAttachedComponent<T>(ICommonSession? session, [MaybeNullWhen(false)] out T component)
where T : IComponent
where T : class, IComponent
{
component = default;
@@ -188,7 +188,7 @@ namespace Content.Shared.GameObjects.EntitySystems
if (ent == null || !ent.IsValid())
return false;
if (!ent.TryGetComponent(out T comp))
if (!ent.TryGetComponent(out T? comp))
return false;
component = comp;