Enable nullability in Content.Server (#3685)

This commit is contained in:
DrSmugleaf
2021-03-16 15:50:20 +01:00
committed by GitHub
parent 90fec0ed24
commit a5ade526b7
306 changed files with 1616 additions and 1441 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.Preferences;
using Content.Shared.Roles;
@@ -45,7 +46,7 @@ namespace Content.Server.GameTicking
.Where(j =>
{
var (jobId, priority) = j;
if (!_prototypeManager.TryIndex(jobId, out JobPrototype job))
if (!_prototypeManager.TryIndex(jobId, out JobPrototype? job))
{
// Job doesn't exist, probably old data?
return false;
@@ -145,7 +146,7 @@ namespace Content.Server.GameTicking
{
var available = GetAvailablePositions();
bool TryPick(JobPriority priority, out string jobId)
bool TryPick(JobPriority priority, [NotNullWhen(true)] out string? jobId)
{
var filtered = profile.JobPriorities
.Where(p => p.Value == priority)