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

@@ -87,7 +87,7 @@ namespace Content.Server
return true;
}
OOCPostMessage message = null;
OOCPostMessage? message = null;
try
{
message = context.RequestBodyJson<OOCPostMessage>();
@@ -119,30 +119,30 @@ namespace Content.Server
[JsonObject(MemberSerialization.Fields)]
private class MoMMIMessageBase
{
[JsonProperty("password")] public string Password;
[JsonProperty("password")] public string Password = null!;
[JsonProperty("type")] public string Type;
[JsonProperty("type")] public string Type = null!;
[JsonProperty("contents")] public object Contents;
[JsonProperty("contents")] public object Contents = null!;
}
[JsonObject(MemberSerialization.Fields)]
private class MoMMIMessageOOC
{
[JsonProperty("sender")] public string Sender;
[JsonProperty("sender")] public string Sender = null!;
[JsonProperty("contents")] public string Contents;
[JsonProperty("contents")] public string Contents = null!;
}
[JsonObject(MemberSerialization.Fields, ItemRequired = Required.Always)]
private class OOCPostMessage
{
#pragma warning disable CS0649
[JsonProperty("password")] public string Password;
[JsonProperty("password")] public string Password = null!;
[JsonProperty("sender")] public string Sender;
[JsonProperty("sender")] public string Sender = null!;
[JsonProperty("contents")] public string Contents;
[JsonProperty("contents")] public string Contents = null!;
#pragma warning restore CS0649
}
}