Browse Source

Fix nullability warnings for new Newtonsoft version

pull/86/head
Anairkoen Schno 2 years 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<>)) if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>))
{ // this is a Nullable { // this is a Nullable
//Logger.log.Debug($"gives NullableConverter<{Nullable.GetUnderlyingType(t)}>"); //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}"); //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())) throw new InvalidOperationException()))
manifest = manifestReader.ReadToEnd(); 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); PluginsMetadata.Add(selfMeta);
SelfMeta = selfMeta; SelfMeta = selfMeta;
@ -276,7 +277,14 @@ namespace IPA.Loader
IsBare = true, 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) if (metadata.Manifest.Files.Length < 1)
Logger.Loader.Warn($"Bare manifest {Path.GetFileName(manifest)} does not declare any files. " + 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 # 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" $codeDomProviderVer = "3.6.0"
$roslynVer = "3.10.0" $roslynVer = "3.10.0"
$nugetBase = "$(Get-Location)/nuget" $nugetBase = "$(Get-Location)/nuget"


+ 1
- 1
docs/docfx.json View File

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


Loading…
Cancel
Save