diff --git a/Src/Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs b/Src/Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs index b80f696d..435e4573 100644 --- a/Src/Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs +++ b/Src/Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs @@ -129,7 +129,7 @@ namespace Newtonsoft.Json.Linq if (_dictionary != null) { - return _dictionary.ContainsKey(key) && Remove(_dictionary[key]); + return _dictionary.TryGetValue(key, out JToken value) && Remove(value); } return false;