diff --git a/Src/Directory.Build.props b/Src/Directory.Build.props index 11ecc4181..661350885 100644 --- a/Src/Directory.Build.props +++ b/Src/Directory.Build.props @@ -3,10 +3,9 @@ 4.6.2 0.10.10 4.2.3 - 2.9.2 + 5.0.3 4.3.0 - 1.0.0-beta2-19367-01 - 3.8.0 + 1.0.0 16.3.0 4.8.1 3.11.0 diff --git a/Src/Newtonsoft.Json/JsonSerializer.cs b/Src/Newtonsoft.Json/JsonSerializer.cs index c4e6b6930..23f5c6b62 100644 --- a/Src/Newtonsoft.Json/JsonSerializer.cs +++ b/Src/Newtonsoft.Json/JsonSerializer.cs @@ -867,9 +867,7 @@ internal virtual void PopulateInternal(JsonReader reader, object target) [DebuggerStepThrough] public T? Deserialize(JsonReader reader) { -#pragma warning disable CS8601 // Possible null reference assignment. - return (T)Deserialize(reader, typeof(T)); -#pragma warning restore CS8601 // Possible null reference assignment. + return (T?)Deserialize(reader, typeof(T)); } /// diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.csproj index bbb6328aa..4dd7b55a0 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.csproj @@ -39,10 +39,8 @@ - + - - Json.NET diff --git a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs index 9b62e0709..a92e2639b 100644 --- a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs +++ b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs @@ -492,8 +492,12 @@ void IDictionary.Add(object key, object value) #endif else { + // Consider changing this code to call GenericDictionary.Remove when value is null. + // #pragma warning disable CS8601 // Possible null reference assignment. +#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. GenericDictionary[(TKey)key] = (TValue)value; +#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. #pragma warning restore CS8601 // Possible null reference assignment. } }