Browse Source

Fix nullability warnings for new Newtonsoft version

pull/86/head
Anairkoen Schno 1 year ago
parent
commit
77904196e3
No known key found for this signature in database GPG Key ID: 40F6F33603F1772D
4 changed files with 14 additions and 6 deletions
  1. +1
    -1
      IPA.Loader/Config/Stores/Converters.cs
  2. +10
    -2
      IPA.Loader/Loader/PluginLoader.cs
  3. +2
    -2
      docs/build.ps1
  4. +1
    -1
      docs/docfx.json

+ 1
- 1
IPA.Loader/Config/Stores/Converters.cs View File

@ -80,7 +80,7 @@ namespace IPA.Config.Stores.Converters
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>))
{ // this is a Nullable
//Logger.log.Debug($"gives NullableConverter<{Nullable.GetUnderlyingType(t)}>");
return (typeof(NullableConverter<>).MakeGenericType(Nullable.GetUnderlyingType(t)));
return typeof(NullableConverter<>).MakeGenericType(Nullable.GetUnderlyingType(t));
}
//Logger.log.Debug($"gives converter for value type {t}");


+ 10
- 2
IPA.Loader/Loader/PluginLoader.cs View File

@ -104,7 +104,8 @@ namespace IPA.Loader
throw new InvalidOperationException()))
manifest = manifestReader.ReadToEnd();
selfMeta.Manifest = JsonConvert.DeserializeObject<PluginManifest>(manifest);
var manifestObj = JsonConvert.DeserializeObject<PluginManifest>(manifest);
selfMeta.Manifest = manifestObj ?? throw new InvalidOperationException("Deserialized manifest was null");
PluginsMetadata.Add(selfMeta);
SelfMeta = selfMeta;
@ -276,7 +277,14 @@ namespace IPA.Loader
IsBare = true,
};
metadata.Manifest = JsonConvert.DeserializeObject<PluginManifest>(File.ReadAllText(manifest));
var manifestObj = JsonConvert.DeserializeObject<PluginManifest>(File.ReadAllText(manifest));
if (manifestObj is null)
{
Logger.Loader.Error($"Bare manifest {Path.GetFileName(manifest)} deserialized to null");
continue;
}
metadata.Manifest = manifestObj;
if (metadata.Manifest.Files.Length < 1)
Logger.Loader.Warn($"Bare manifest {Path.GetFileName(manifest)} does not declare any files. " +


+ 2
- 2
docs/build.ps1 View File

@ -7,8 +7,8 @@ if ($PSEdition -eq "Core") {
# read SelfConfig, remove wierd bits, load it, load Newtonsoft, and turn it into a schema
$newtonsoftVer = "12.0.2"
$newtonsoftSchemaVer = "3.0.11"
$newtonsoftVer = "13.0.1"
$newtonsoftSchemaVer = "3.0.15-beta2"
$codeDomProviderVer = "3.6.0"
$roslynVer = "3.10.0"
$nugetBase = "$(Get-Location)/nuget"


+ 1
- 1
docs/docfx.json View File

@ -20,7 +20,7 @@
"disableGitFeatures": false,
"disableDefaultFilter": false,
"properties": {
"TargetFramework": "net461"
"TargetFramework": "net472"
}
}],
"build": {


Loading…
Cancel
Save