fix nullability warnings
This commit is contained in:
parent
8dc12fd01c
commit
d0704ef6f0
|
@ -382,11 +382,11 @@ namespace SMAPI.Tests.Utilities
|
|||
{
|
||||
// act
|
||||
string json = JsonConvert.SerializeObject(new SemanticVersion(versionStr));
|
||||
SemanticVersion after = JsonConvert.DeserializeObject<SemanticVersion>(json);
|
||||
SemanticVersion? after = JsonConvert.DeserializeObject<SemanticVersion>(json);
|
||||
|
||||
// assert
|
||||
Assert.IsNotNull(after, "The semantic version after deserialization is unexpectedly null.");
|
||||
Assert.AreEqual(versionStr, after.ToString(), "The semantic version after deserialization doesn't match the input version.");
|
||||
Assert.AreEqual(versionStr, after!.ToString(), "The semantic version after deserialization doesn't match the input version.");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -361,7 +361,7 @@ else if (log?.IsValid == true)
|
|||
ContentPacks: contentPacks?.TryGetValue(mod.Name, out LogModInfo[]? contentPackList) == true ? contentPackList : Array.Empty<LogModInfo>()
|
||||
))
|
||||
.ToList();
|
||||
if (contentPacks?.TryGetValue("", out LogModInfo[] invalidPacks) == true)
|
||||
if (contentPacks?.TryGetValue("", out LogModInfo[]? invalidPacks) == true)
|
||||
{
|
||||
modsWithContentPacks.Add((
|
||||
Mod: new LogModInfo(ModType.CodeMod, "<invalid content packs>", "", "", ""),
|
||||
|
|
Loading…
Reference in New Issue